Commit 24b7825a authored by Thomas B. Rücker's avatar Thomas B. Rücker 😊
Browse files

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
parent 06977d78
...@@ -822,19 +822,26 @@ int connection_complete_source (source_t *source, int response) ...@@ -822,19 +822,26 @@ int connection_complete_source (source_t *source, int response)
{ {
config_release_config(); config_release_config();
global_unlock(); global_unlock();
if (response) if (response) {
{
client_send_403 (source->client, "Content-type not supported"); client_send_403 (source->client, "Content-type not supported");
source->client = NULL; source->client = NULL;
} }
ICECAST_LOG_WARN("Content-type \"%s\" not supported, dropping source", contenttype); ICECAST_LOG_WARN("Content-type \"%s\" not supported, dropping source", contenttype);
return -1; return -1;
} }
} } else if (source->parser->req_type == httpp_req_put) {
else config_release_config();
{ global_unlock();
ICECAST_LOG_WARN("No content-type header, falling back to backwards compatibility mode " if (response) {
"for icecast 1.x relays. Assuming content is mp3."); 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; format_type = FORMAT_TYPE_GENERIC;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment