1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Applying patch, HTTP PUT requires content-type

In case of SOURCE we are lenient and thus quite some source clients
don't send a proper content-type, especially if they only support mp3.

This was meant to be introduced in 2.4.0 already, sadly we missed it.

All source clients MUST send proper content-type after migrating to 
Icecast HTTP PUT protocol.

closes #2082

svn path=/icecast/trunk/icecast/; revision=19288
This commit is contained in:
Thomas B. "dm8tbr" Ruecker 2014-11-08 16:23:26 +00:00
parent 06977d788c
commit 24b7825adb

View File

@ -822,19 +822,26 @@ int connection_complete_source (source_t *source, int response)
{
config_release_config();
global_unlock();
if (response)
{
if (response) {
client_send_403 (source->client, "Content-type not supported");
source->client = NULL;
}
ICECAST_LOG_WARN("Content-type \"%s\" not supported, dropping source", contenttype);
return -1;
}
}
else
{
ICECAST_LOG_WARN("No content-type header, falling back to backwards compatibility mode "
"for icecast 1.x relays. Assuming content is mp3.");
} else if (source->parser->req_type == httpp_req_put) {
config_release_config();
global_unlock();
if (response) {
client_send_403 (source->client, "No Content-type given");
source->client = NULL;
}
ICECAST_LOG_ERROR("Content-type not given in PUT request, dropping source");
return -1;
} else {
ICECAST_LOG_ERROR("No content-type header, falling back to backwards compatibility mode "
"for icecast 1.x relays. Assuming content is mp3. This behaviour is deprecated "
"and the source client will NOT work with future Icecast versions!");
format_type = FORMAT_TYPE_GENERIC;
}