get_http_file_name if not content_type

This commit is contained in:
Yago 2015-02-27 22:20:05 +01:00
parent 73f3a21904
commit 2e6c0f823d

View File

@ -46,7 +46,10 @@ function get_http_file_name(url, headers)
content_type = content_type or headers["Content-type"] content_type = content_type or headers["Content-type"]
content_type = content_type or h["Content-Type"] content_type = content_type or h["Content-Type"]
local extension = mimetype.get_mime_extension(content_type) local extension = nil
if content_type then
extension = mimetype.get_mime_extension(content_type)
end
if extension then if extension then
file_name = file_name.."."..extension file_name = file_name.."."..extension
end end