mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
Fix: Do not announce Upgrade to TLS on TLS Mode DISABLED sockets
This commit is contained in:
parent
a864fbf47a
commit
9cbc110f78
@ -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" : ""),
|
||||
|
Loading…
Reference in New Issue
Block a user