Fix parsing of clean_url (#31783)
In #31618 the idea was to determine the file extension heuristically by dropping query params etc from a url and then consider it as a file path. That broke for URLs that only have query params like http://example.com/?patch=x as it would result in empty string as basename. This PR reverts to the old behavior of saving files as ?patch=x in that case. Co-authored-by: Stephen Sachs <stesachs@amazon.com>
This commit is contained in:
parent
2dd4795f56
commit
584cc47fb3
1 changed files with 2 additions and 2 deletions
|
@ -366,9 +366,9 @@ def expected_archive_files(self):
|
||||||
fnames = []
|
fnames = []
|
||||||
expanded = True
|
expanded = True
|
||||||
if isinstance(self.default_fetcher, fs.URLFetchStrategy):
|
if isinstance(self.default_fetcher, fs.URLFetchStrategy):
|
||||||
url_path = url_util.parse(self.default_fetcher.url).path
|
|
||||||
expanded = self.default_fetcher.expand_archive
|
expanded = self.default_fetcher.expand_archive
|
||||||
clean_url = os.path.basename(sup.sanitize_file_path(url_path))
|
clean_url = os.path.basename(
|
||||||
|
sup.sanitize_file_path(self.default_fetcher.url))
|
||||||
fnames.append(clean_url)
|
fnames.append(clean_url)
|
||||||
|
|
||||||
if self.mirror_paths:
|
if self.mirror_paths:
|
||||||
|
|
Loading…
Reference in a new issue