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

KTOR-7934 Remove Content-Length for browser #4621

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

bjhham
Copy link
Contributor

@bjhham bjhham commented Jan 23, 2025

Subsystem
Client, Js

Motivation
KTOR-7934 JS/WASM fails with "IllegalStateException: Content-Length mismatch" on requesting gzipped content

Solution
Requests from the browser will always remove the Content-Encoding and Content-Length headers. This is because Content-Encoding can be stripped by the browser while an inaccurate Content-Length remains. This depends on the server, but is common based on the CORS policy.

@bjhham bjhham force-pushed the bjhham/content-length-browser-fix branch from fb4e99b to 359f2fc Compare January 24, 2025 09:07
@bjhham bjhham requested a review from e5l January 24, 2025 10:03
@bjhham bjhham force-pushed the bjhham/content-length-browser-fix branch from 359f2fc to d865f73 Compare January 24, 2025 10:17
@bjhham bjhham enabled auto-merge (rebase) January 27, 2025 10:50
@bjhham bjhham merged commit 2efc770 into main Jan 27, 2025
15 of 16 checks passed
@bjhham bjhham deleted the bjhham/content-length-browser-fix branch January 27, 2025 14:26
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