Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion openaddr/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ def guess_url_file_extension(url):
mimetypes.add_type('application/vnd.geo+json', '.json', False)

_, likely_ext = os.path.splitext(path)
bad_extensions = '', '.cgi', '.php', '.aspx', '.asp', '.do'
if likely_ext == '.gz':
_, compressed_ext = os.path.splitext(path[:-3])
if compressed_ext:
likely_ext = compressed_ext + likely_ext

bad_extensions = "", ".cgi", ".php", ".aspx", ".asp", ".do"

if not query and likely_ext not in bad_extensions:
#
Expand Down