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

Fix Content-Length for rack >= 2.1.0 #290

Merged
merged 1 commit into from
May 28, 2020

Conversation

p8
Copy link
Member

@p8 p8 commented May 28, 2020

Since rack 2.1.0 the Content-Length header is no longer updated for
if the body argument isn't a string. This was done for performance
reasons. It is recommended to set Content-Length header in the
middlewate instead.

See: rack/rack#1472 (comment)

This fixes the build.

# the body. Otherwise the response will be truncated.
@headers.delete("Content-Length")
# Set Content-Length header to the size of the current body
# + the extra conent. Otherwise the response will be truncated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# + the extra conent. Otherwise the response will be truncated.
# + the extra content. Otherwise the response will be truncated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Fixed the comment.

Since rack 2.1.0 the Content-Length header is no longer updated for
if the body argument isn't a string. This was done for performance
reasons. It is recommended to set Content-Length header in the
middlewate instead.

rack/rack#1472 (comment)
@rafaelfranca rafaelfranca merged commit d9fd6d2 into rails:master May 28, 2020
@p8 p8 deleted the fix-for-rack-2.1.0 branch May 28, 2020 20:54
mishina2228 added a commit to mishina2228/web-console that referenced this pull request Jun 8, 2022
mishina2228 added a commit to mishina2228/web-console that referenced this pull request Jun 9, 2022
patrickm68 added a commit to patrickm68/web-console that referenced this pull request Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants