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

Make sure that content-length header can never be deleted #504

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

chvp
Copy link
Member

@chvp chvp commented Nov 8, 2023

Once the response is committed, the headers can't be edited anymore, which is exactly what we want in this case.

Unfortunately, this can't be added to the tests, because the way responses and ActionController::Live work in tests just doesn't allow it (in fact, the tests already "test" for the presence of this header, and the tests still succeed even though in production the header is not present).

Fixes #503.

@chvp chvp marked this pull request as ready for review November 8, 2023 21:47
@chvp chvp requested a review from robbevp November 8, 2023 21:47
@chvp chvp added the bug Something isn't working label Nov 8, 2023
Once the response is `commit`ted, the headers can't be edited anymore, which is
exactly what we want in this case.
@chvp chvp force-pushed the fix/streaming-content-length branch from b997a39 to c410fdc Compare November 8, 2023 21:49
@chvp
Copy link
Member Author

chvp commented Nov 8, 2023

(I've already applied this fix in our production instance, because it was quite annoying.)

@chvp chvp merged commit c742e60 into main Nov 9, 2023
4 checks passed
@chvp chvp deleted the fix/streaming-content-length branch November 9, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

content-length header isn't set for streaming audio responses anymore since rails 7.1
2 participants