download_strategy: Miscalculated redirect when Location: is protocol-relative
This commit is contained in:
parent
c5a3cb75f3
commit
041cd039f7
@ -336,7 +336,10 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
.compact
|
||||
|
||||
redirect_url = locations.reduce(url) do |current_url, location|
|
||||
if location.start_with?("/")
|
||||
if location.start_with?("//")
|
||||
uri = URI(current_url)
|
||||
"#{uri.scheme}:#{location}"
|
||||
elsif location.start_with?("/")
|
||||
uri = URI(current_url)
|
||||
"#{uri.scheme}://#{uri.host}#{location}"
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user