Merge pull request #5337 from EricFromCanada/current-dir-redirect
CurlDownloadStrategy: handle Location header indicating the current directory
This commit is contained in:
commit
e3f69a48b5
@ -353,6 +353,9 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
|||||||
elsif location.start_with?("/")
|
elsif location.start_with?("/")
|
||||||
uri = URI(current_url)
|
uri = URI(current_url)
|
||||||
"#{uri.scheme}://#{uri.host}#{location}"
|
"#{uri.scheme}://#{uri.host}#{location}"
|
||||||
|
elsif location.start_with?("./")
|
||||||
|
uri = URI(current_url)
|
||||||
|
"#{uri.scheme}://#{uri.host}#{Pathname(uri.path).dirname/location}"
|
||||||
else
|
else
|
||||||
location
|
location
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user