Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ ssize_t client_get_baseurl(client_t *client, listensocket_t *listensocket, char
const listener_t *listener = NULL;
const ice_config_t *config = NULL;
const char *host = NULL;
const char *forwarded_proto = NULL;
const char *proto = "http";
int port = 0;
ssize_t ret;
Expand Down Expand Up @@ -1145,7 +1146,15 @@ ssize_t client_get_baseurl(client_t *client, listensocket_t *listensocket, char
case ICECAST_TLSMODE_DISABLED:
case ICECAST_TLSMODE_AUTO:
switch (protocol) {
case ICECAST_PROTOCOL_HTTP: proto = "http"; break;
case ICECAST_PROTOCOL_HTTP:
proto = "http";
if (client) {
forwarded_proto = httpp_getvar(client->parser, "x-forwarded-proto");
if (forwarded_proto && strcmp(forwarded_proto, "https") == 0) {
proto = "https";
}
}
break;
case ICECAST_PROTOCOL_SHOUTCAST: proto = "icy"; break;
}
break;
Expand Down