mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
FS-7496 Updated mime.types, added switch_core_mime_type2ext function and used it in mod_httapi. Now, file extensions defined in mime.types will be applied if mod_httapi downloads a file without one.
This commit is contained in:
@@ -2780,12 +2780,7 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char
|
||||
}
|
||||
|
||||
if (zstr(ext) && headers && (ct = switch_event_get_header(headers, "content-type"))) {
|
||||
if (switch_strcasecmp_any(ct, "audio/mpeg", "audio/x-mpeg", "audio/mp3", "audio/x-mp3", "audio/mpeg3",
|
||||
"audio/x-mpeg3", "audio/mpg", "audio/x-mpg", "audio/x-mpegaudio", NULL)) {
|
||||
newext = "mp3";
|
||||
} else if (switch_strcasecmp_any(ct, "audio/x-wav", "audio/x-wave", "audio/wav", "audio/wave", NULL)) {
|
||||
newext = "wav";
|
||||
}
|
||||
newext = switch_core_mime_type2ext(ct);
|
||||
}
|
||||
|
||||
if (newext) {
|
||||
|
||||
Reference in New Issue
Block a user