forwardemail / forwardemail/superagent

Request hang when statusCode=204 and content-encoding = gzip

Open
#1,597 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

In my test, I have below request

Response 204- no content
but in the header I have
`content-encoding: gzip`
`transfer-encoding: chunked`

I know that is the invalid header for 204 but this is not in my control,

In this case, my code keeps hanging forever without any error

My proposal is if the response is 204 and the incoming stream is empty, we can ignore the gzip

Note: I tested the same request with the postman and got a successful response with an empty body

Working:
![image](https://user-images.githubusercontent.com/1183138/95146239-0c3bd200-07c9-11eb-88b6-031110512010.png)

Not working:
![image](https://user-images.githubusercontent.com/1183138/95146293-2970a080-07c9-11eb-8958-a076e2bc6f0b.png)

After many test, I can confirm when `transfer-encoding: chunked` and status=204 it will cause this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.