Ticket #1963: 0001-Send-an-HTTP-Accept-header.patch

File 0001-Send-an-HTTP-Accept-header.patch, 1.0 KB (added by bart@…, 15 years ago)

patch to send HTTP Accept header

  • stream/network.c

    From 1ca81288bfe80df52c3f4d1d2012bb74da5f71b9 Mon Sep 17 00:00:00 2001
    From: Bart Nagel <bart@tremby.net>
    Date: Fri, 12 Aug 2011 21:38:41 +0100
    Subject: [PATCH] Send an HTTP Accept header
    
    When streaming over HTTP, specify with the request that we prefer audio and
    video mimetypes, then application mimetypes (the official mimetype for Ogg
    streams, for instance, is application/ogg), then anything else.
    ---
     stream/network.c |    3 +++
     1 files changed, 3 insertions(+), 0 deletions(-)
    
    diff --git a/stream/network.c b/stream/network.c
    index cebb85c..fbbd525 100644
    a b http_send_request( URL_t *url, off_t pos ) {  
    219219            snprintf(str, sizeof(str), "User-Agent: %s", mplayer_version);
    220220        http_set_field(http_hdr, str);
    221221
     222        snprintf(str, sizeof(str), "Accept: video/*, audio/*, application/*;q=0.9, */*;q=0.5");
     223        http_set_field(http_hdr, str);
     224
    222225        if (network_referrer) {
    223226            char *referrer = NULL;
    224227            size_t len = strlen(network_referrer) + 10;