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,
ssize_t ret;
char * extra_headers;
const char *connection_header = "Close";
const char *upgrade_header = "";
if (!out)
return -1;
......@@ -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_UPGRADETLS: connection_header = "Upgrade"; break;
}
if (client->con->tlsmode != ICECAST_TLSMODE_DISABLED)
upgrade_header = "Upgrade: TLS/1.0\r\n";
}
if (offset == -1)
......@@ -758,7 +761,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
connection_header,
(client && client->admin_command == ADMIN_COMMAND_ERROR ?
"GET, SOURCE" : "GET"),
(config->tls_ok ? "Upgrade: TLS/1.0\r\n" : ""),
upgrade_header,
currenttime_buffer,
contenttype_buffer,
(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