1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-02 06:01:10 +00:00

Fix: Allow Content-type: with parameters (such as codecs, or charset)

See: #1902
This commit is contained in:
Philipp Schafft 2021-10-30 08:49:07 +00:00
parent 4bffe21d4c
commit f104fd5551

View File

@ -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)