summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Hannah <james.hannah@bytemark.co.uk>2014-10-13 13:21:59 +0100
committerJames Hannah <james.hannah@bytemark.co.uk>2014-10-13 13:21:59 +0100
commit40e5be016f116a9a54113a19894174f7c75ef28b (patch)
tree2fd4e55d3af2ecbe761f3b610f2686fb4a4e061b
parent98b8f3bbb1d0824fae5a6e87950c1e6fec871d33 (diff)
Added support for overriding the HTTP Host header
-rw-r--r--lib/custodian/protocoltest/http.rb10
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