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

[HTML5] Disable body_size in fetch. #47597

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Apr 3, 2021

We were using Content-Length from the server when Content-Encoding
was not set (i.e. response was not compressed).

Sadly, in CORS requests accessing headers is restricted, and while
Content-Length is enabled by default, Content-Encoding is not.

This results in the impossibility of knowing if the content was
compressed, unless the server explicitly enabled the encoding header
via Access-Control-Expose-Headers.

To keep maximum compatibility we must disable body_size completely.

Fixes heroiclabs/nakama-godot#66

Allowed headers: https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_response_header

We were using `Content-Length` from the server when `Content-Encoding`
was not set (i.e. response was not compressed).

Sadly, in CORS requests accessing headers is restricted, and while
`Content-Length` is enabled by default, `Content-Encoding` is not.

This results in the impossibility of knowing if the content was
compressed, unless the server explicitly enabled the encoding header
via `Access-Control-Expose-Headers`.

To keep maximum compatibility we must disable `body_size` completely.
@Faless Faless added bug platform:web topic:porting topic:network cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.3 labels Apr 3, 2021
@Faless Faless added this to the 4.0 milestone Apr 3, 2021
@Faless Faless requested a review from a team as a code owner April 3, 2021 13:11
@akien-mga akien-mga merged commit 460bef1 into godotengine:master Apr 5, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML5 authenticate_device_async(): HTTPRequest failed!
2 participants