From 40e5be016f116a9a54113a19894174f7c75ef28b Mon Sep 17 00:00:00 2001 From: James Hannah Date: Mon, 13 Oct 2014 13:21:59 +0100 Subject: Added support for overriding the HTTP Host header --- lib/custodian/protocoltest/http.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/custodian') 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 -- cgit v1.2.1