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

fix: don't set Content-Length in XMLHttpRequest fn #554

Merged

Conversation

jkaho
Copy link
Contributor

@jkaho jkaho commented Sep 2, 2024

Setting the Content-Length request header in the context of an XMLHttpRequest leads to the error:

Refused to set unsafe header "Content-Length"

This header is considered a forbidden request header that can't be set with setRequestHeader(). I've confirmed that the initial implementation was unnecessary: #358 (comment).

See the XMLHttpRequest specs:

CR-6763

Copy link

codesandbox-ci bot commented Sep 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@jkaho jkaho force-pushed the CR-6763/do-not-set-content-length-header-in-xmlhttprequest branch from 0213f54 to fa4ca3f Compare September 2, 2024 07:58
@jkaho jkaho marked this pull request as ready for review September 2, 2024 07:59
@jkaho jkaho requested a review from a team as a code owner September 2, 2024 07:59
@jkaho jkaho requested a review from JasonBerry September 2, 2024 07:59
@jkaho jkaho merged commit e3aaa8e into main Sep 3, 2024
4 checks passed
@jkaho jkaho deleted the CR-6763/do-not-set-content-length-header-in-xmlhttprequest branch September 3, 2024 00:29
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