]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
HTTP: ignore "Content-Encoding: compress"
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Fri, 24 Jul 2015 22:46:01 +0000 (00:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Jul 2015 22:46:01 +0000 (00:46 +0200)
Currently, libcurl rejects responses with "Content-Encoding: compress"
when CURLOPT_ACCEPT_ENCODING is set to "". I think that libcurl should
treat the Content-Encoding "compress" the same as other
Content-Encodings that it does not support, e.g. "bzip2". That means
just ignoring it.

lib/http.c
lib/http_chunks.c
lib/transfer.c
lib/urldata.h

index b9e8047716c3fdebb6fd0949cd5a0874637ff56f..a1eef815b26a9cc7fa6bde83c124453123c4b7b9 100644 (file)
@@ -3582,14 +3582,6 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
           k->auto_decoding = GZIP;
           start += 6;
         }
-        else if(checkprefix("compress", start)) {
-          k->auto_decoding = COMPRESS;
-          start += 8;
-        }
-        else if(checkprefix("x-compress", start)) {
-          k->auto_decoding = COMPRESS;
-          start += 10;
-        }
         else
           /* unknown! */
           break;
@@ -3622,9 +3614,6 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
       else if(checkprefix("gzip", start)
               || checkprefix("x-gzip", start))
         k->auto_decoding = GZIP;
-      else if(checkprefix("compress", start)
-              || checkprefix("x-compress", start))
-        k->auto_decoding = COMPRESS;
     }
     else if(checkprefix("Content-Range:", k->p)) {
       /* Content-Range: bytes [num]-
index 80c0f9548685643bccbba84529411bb6fb9e4d4d..7e91b37dcfe5d006f78896d8c21900426ed6ada3 100644 (file)
@@ -218,7 +218,6 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
                                           (ssize_t)piece);
         break;
 
-      case COMPRESS:
       default:
         failf (conn->data,
                "Unrecognized content encoding type. "
index 32e8702e6869a36eab3ef2320cfb4b6cb8132a61..718139b32623e6ea442bdc9570052569dd60c857 100644 (file)
@@ -756,7 +756,6 @@ static CURLcode readwrite_data(struct SessionHandle *data,
               result = Curl_unencode_gzip_write(conn, k, nread);
             break;
 
-          case COMPRESS:
           default:
             failf (data, "Unrecognized content encoding type. "
                    "libcurl understands `identity', `deflate' and `gzip' "
index 06559229bdd1cf95cb242336cf264eff07e92201..b1c2056c5165e1ebb9f8a19fb91348b5878b9445 100644 (file)
@@ -660,7 +660,6 @@ struct SingleRequest {
 #define IDENTITY 0              /* No encoding */
 #define DEFLATE 1               /* zlib deflate [RFC 1950 & 1951] */
 #define GZIP 2                  /* gzip algorithm [RFC 1952] */
-#define COMPRESS 3              /* Not handled, added for completeness */
 
 #ifdef HAVE_LIBZ
   zlibInitState zlib_init;      /* possible zlib init state;