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

ResponseEmitter: Don't remove Content-Type and Content-Length when body is empty #2925

Merged
merged 2 commits into from
Jan 30, 2020
Merged

Conversation

proton-ab
Copy link
Contributor

@proton-ab proton-ab commented Jan 29, 2020

Fixes #2924

I am not really sure what would be the best way to allow users to control behavior here and I think trying to guess whether user wants this behavior (like by checking against well known X-Accel-Redirect header or HEAD method) is gonna end with unnecessary logic on our side as the list of conditions grows to accommodate different web servers and CDNs.

I am also not sure whether we need to grow ResponseEmitter by such logic. Correct me if I'm wrong, but I believe this would only get into play if user specifically set ->withHeader on empty body before, right?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f087928 on proton-ab:patch-1 into 7462682 on slimphp:4.x.

@l0gicgate l0gicgate added this to the 4.5.0 milestone Jan 30, 2020
@l0gicgate l0gicgate merged commit 2058eea into slimphp:4.x Jan 30, 2020
@l0gicgate l0gicgate mentioned this pull request Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResponseEmitter should not remove Content-Type and Content-Length when body is empty due to HEAD being used
3 participants