mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Fix: Allow Content-type: with parameters (such as codecs, or charset)
See: #1902
This commit is contained in:
parent
4bffe21d4c
commit
f104fd5551
@ -54,6 +54,15 @@ static int format_prepare_headers (source_t *source, client_t *client);
|
||||
|
||||
format_type_t format_get_type (const char *contenttype)
|
||||
{
|
||||
char buf[32];
|
||||
const char *separator = strpbrk(contenttype, "; \t");
|
||||
|
||||
if (separator && (size_t)(separator - contenttype) < sizeof(buf)) {
|
||||
memcpy(buf, contenttype, separator - contenttype);
|
||||
buf[separator - contenttype] = 0;
|
||||
contenttype = buf;
|
||||
}
|
||||
|
||||
if(strcmp(contenttype, "application/x-ogg") == 0)
|
||||
return FORMAT_TYPE_OGG; /* Backwards compatibility */
|
||||
else if(strcmp(contenttype, "application/ogg") == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user