Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add content-length: 0 for no content responses #124

Merged
merged 1 commit into from Mar 12, 2014

Conversation

@grandbora
Copy link
Contributor

commented Mar 12, 2014

  • adds Content-Length: 0 header to no content responses

In the current version content length header is not added if there isn't any content in the response. This behaviour creates a problem when accessing finatra application through an nginx proxy server. Since application doesn't send length data, the proxy server keeps the connection open until it times out. This results into long response times for responses to option requests, 301 responses etc.

Here I created two endpoints where the difference can be observed. Although when accessed from browser both endpoints behaves the same (and fine), when accessed via curl the behaviour is different. On the /redirect-without-header endpoint curl hangs forever.

cc @pcalcado @streadway

grandbora

capotej added a commit that referenced this pull request Mar 12, 2014

Merge pull request #124 from grandbora/master
Add content-length: 0 for no content responses

@capotej capotej merged commit e485028 into twitter:master Mar 12, 2014

1 check passed

default The Travis CI build passed
Details
@capotej

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2014

Nice find, thanks!

cacoco pushed a commit that referenced this pull request May 13, 2015

Merge pull request #124 from grandbora/master
Add content-length: 0 for no content responses

cacoco pushed a commit that referenced this pull request May 14, 2015

Merge pull request #124 from grandbora/master
Add content-length: 0 for no content responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.