From 35ea95637aa0921adfd5c2c321eb3cff0da88d42 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') 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