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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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