summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-16 13:31:43 -0700
committerGitHub <noreply@github.com>2018-03-16 13:31:43 -0700
commit2b729ba44310ba46136648e30fe2ef3cd94a6771 (patch)
tree3574b90ed34980ae4d138edf500e59649e9c7e71
parent7ed08da937734d168fbe4742f3617ab90b614da4 (diff)
parent295d7ee3c9dc564a48d3d69d4512365ca8571402 (diff)
downloadchef-2b729ba44310ba46136648e30fe2ef3cd94a6771.tar.gz
Merge pull request #6996 from chef/fix_http_request
Revert "Stripping out Authorization header on redirect to a different host
-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."