Skip to content

Commit

Permalink
Merge pull request #54 from openaddresses/use-content-disposition-ext…
Browse files Browse the repository at this point in the history
…ension

Use file extension from content disposition header instead of giving up
  • Loading branch information
iandees authored Sep 9, 2023
2 parents c484161 + 263afce commit c7a5d93
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openaddr/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ def guess_url_file_extension(url):
if path_ext == attachment_ext:
_L.debug('Content-Disposition agrees: "{}"'.format(match.group('filename')))
else:
_L.debug('Content-Disposition disagrees: "{}"'.format(match.group('filename')))
path_ext = False
_L.debug('Content-Disposition disagrees: "{}" says we should use "{}", using "{}" instead'.format(
match.group('filename'),
attachment_ext,
path_ext,
))

if not path_ext:
#
Expand Down

0 comments on commit c7a5d93

Please sign in to comment.