From 24b7825adb1f8ac5a33e822ae032f875b3360668 Mon Sep 17 00:00:00 2001 From: "Thomas B. \"dm8tbr\" Ruecker" Date: Sat, 8 Nov 2014 16:23:26 +0000 Subject: [PATCH] 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 --- src/connection.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/connection.c b/src/connection.c index 53d8f5b4..3cb64ae2 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; }