diff --git a/src/format.c b/src/format.c index 502249073ec15d18e3ee8326f241daf307a50330..fbe53d92369363565aa137b271288207ac578eaa 100644 --- a/src/format.c +++ b/src/format.c @@ -347,6 +347,11 @@ static int format_prepare_headers (source_t *source, client_t *client) remaining -= bytes; ptr += bytes; + /* prevent proxy servers from caching */ + bytes = snprintf (ptr, remaining, "Cache-Control: no-cache\r\n"); + remaining -= bytes; + ptr += bytes; + bytes = snprintf (ptr, remaining, "\r\n"); remaining -= bytes; ptr += bytes; diff --git a/src/format_mp3.c b/src/format_mp3.c index fd7311abb15cba899d24b399dcc73bed676d9b2d..e0687c9e18ffa7262499927d113b897cd5d0a8a0 100644 --- a/src/format_mp3.c +++ b/src/format_mp3.c @@ -638,16 +638,24 @@ static int format_mp3_create_client_data(source_t *source, client_t *client) unsigned remaining = 4096 - client->refbuf->len + 2; char *ptr = client->refbuf->data + client->refbuf->len - 2; int bytes; + const char *useragent; if (client_mp3 == NULL) return -1; - /* hack for flash player, it wants a length */ - if (httpp_getvar(client->parser, "x-flash-version")) + /* hack for flash player, it wants a length. It has also been reported that the useragent + * appears as MSIE if run in internet explorer */ + useragent = httpp_getvar (client->parser, "user-agent"); + if (httpp_getvar(client->parser, "x-flash-version") || + (useragent && strstr(useragent, "MSIE"))) { - bytes = snprintf (ptr, remaining, "Content-Length: 347122319\r\n"); + bytes = snprintf (ptr, remaining, "Content-Length: 221183499\r\n"); remaining -= bytes; ptr += bytes; + /* avoid browser caching, reported via forum */ + bytes = snprintf (ptr, remaining, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"); + remaining -= bytes; + ptr += bytes; } client->format_data = client_mp3;