Commit 9cbc110f authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Do not announce Upgrade to TLS on TLS Mode DISABLED sockets

parent a864fbf4
...@@ -676,6 +676,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, ...@@ -676,6 +676,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
ssize_t ret; ssize_t ret;
char * extra_headers; char * extra_headers;
const char *connection_header = "Close"; const char *connection_header = "Close";
const char *upgrade_header = "";
if (!out) if (!out)
return -1; return -1;
...@@ -686,6 +687,8 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, ...@@ -686,6 +687,8 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
case ICECAST_REUSE_KEEPALIVE: connection_header = "Keep-Alive"; break; case ICECAST_REUSE_KEEPALIVE: connection_header = "Keep-Alive"; break;
case ICECAST_REUSE_UPGRADETLS: connection_header = "Upgrade"; break; case ICECAST_REUSE_UPGRADETLS: connection_header = "Upgrade"; break;
} }
if (client->con->tlsmode != ICECAST_TLSMODE_DISABLED)
upgrade_header = "Upgrade: TLS/1.0\r\n";
} }
if (offset == -1) if (offset == -1)
...@@ -758,7 +761,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, ...@@ -758,7 +761,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
connection_header, connection_header,
(client && client->admin_command == ADMIN_COMMAND_ERROR ? (client && client->admin_command == ADMIN_COMMAND_ERROR ?
"GET, SOURCE" : "GET"), "GET, SOURCE" : "GET"),
(config->tls_ok ? "Upgrade: TLS/1.0\r\n" : ""), upgrade_header,
currenttime_buffer, currenttime_buffer,
contenttype_buffer, contenttype_buffer,
(status == 401 ? "WWW-Authenticate: Basic realm=\"Icecast2 Server\"\r\n" : ""), (status == 401 ? "WWW-Authenticate: Basic realm=\"Icecast2 Server\"\r\n" : ""),
......
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