Skip to content

Commit

Permalink
Strip the Transfer-Encoding header from response
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartatz committed Oct 8, 2023
1 parent eed417d commit 02c583e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,15 @@ size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata)
for (size_t index = 0; index < response.headers.offset; index++) {
const struct HTTPHeader* const header = &response.headers.items[index];

// cURL already performs content decoding, so there is no need for this header
// cURL already performs content decoding, so there is no need for these headers
if (strcasecmp(header->key, "Content-Encoding") == 0) {
continue;
}

if (strcasecmp(header->key, "Transfer-Encoding") == 0) {
continue;
}

// This header will report an incorrect value for compressed responses, so let's just remove it
if (strcasecmp(header->key, "Content-Length") == 0) {
continue;
Expand Down

0 comments on commit 02c583e

Please sign in to comment.