summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-16 12:53:36 -0700
committerTim Smith <tsmith@chef.io>2018-03-16 12:53:36 -0700
commit295d7ee3c9dc564a48d3d69d4512365ca8571402 (patch)
tree3574b90ed34980ae4d138edf500e59649e9c7e71
parent7ed08da937734d168fbe4742f3617ab90b614da4 (diff)
downloadchef-295d7ee3c9dc564a48d3d69d4512365ca8571402.tar.gz
Revert "Stripping out Authorization header on redirect to a different host"
This reverts commit 08b31872bf4094bbef474cae6de6c90fb4245a99.
-rw-r--r--lib/chef/http.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index a10906443b..241806da4e 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -381,9 +381,7 @@ class Chef
elsif redirect_location = redirected_to(response)
if [:GET, :HEAD].include?(method)
follow_redirect do
- redirected_url = url + redirect_location
- headers.delete("Authorization") if url.host != redirected_url.host
- send_http_request(method, redirected_url, headers, body, &response_handler)
+ send_http_request(method, url + redirect_location, headers, body, &response_handler)
end
else
raise Exceptions::InvalidRedirect, "#{method} request was redirected from #{url} to #{redirect_location}. Only GET and HEAD support redirects."