diff options
author | James Hannah <james.hannah@bytemark.co.uk> | 2014-10-13 13:21:59 +0100 |
---|---|---|
committer | James Hannah <james.hannah@bytemark.co.uk> | 2014-10-13 13:21:59 +0100 |
commit | 35ea95637aa0921adfd5c2c321eb3cff0da88d42 (patch) | |
tree | 5c3fed2a64a25a964f1ed65a476c397bb95ba862 /lib/custodian | |
parent | 2a5dd183918abd6184cee2accc3bc03fa2318669 (diff) |
Added support for overriding the HTTP Host header
Diffstat (limited to 'lib/custodian')
-rw-r--r-- | lib/custodian/protocoltest/http.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb index ac41b55..3ceedb3 100644 --- a/lib/custodian/protocoltest/http.rb +++ b/lib/custodian/protocoltest/http.rb @@ -144,6 +144,12 @@ module Custodian if ( line =~ /without\s+cache\s+busting/ ) @cache_busting = false end + + # Do we need to override the HTTP Host: Header? + @host_override = nil + if ( line =~ /with host header '([^']+)'/) + @host_override = $1.dup + end end @@ -247,6 +253,10 @@ module Custodian c.follow_location = true c.max_redirects = 10 end + + unless @host_override.nil? + c.headers["Host"] = @host_override + end c.ssl_verify_host = false c.ssl_verify_peer = false |