CurlDownloadStrategy: handle Location indicating the current dir.
If a response contains a Location header starting with `./`, substitute just final component of the URL path with the given filename.
This commit is contained in:
parent
7241156080
commit
5e2f87f7ac
@ -353,6 +353,9 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
elsif location.start_with?("/")
|
||||
uri = URI(current_url)
|
||||
"#{uri.scheme}://#{uri.host}#{location}"
|
||||
elsif location.start_with?("./")
|
||||
uri = URI(current_url)
|
||||
"#{uri.scheme}://#{uri.host}#{Pathname(uri.path).dirname/location}"
|
||||
else
|
||||
location
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user