Network I/O adding transfer-encoding header to PUT on Windows


Both fetch and XMLHttpRequest are adding an unwanted header transfer-encoding: chunked to any request with the method PUT on Windows only, macOS is fine.

Steps to reproduce

  • make a fetch request with method PUT

Expected Behavior

No transfer-encoding header should be set, as the content-length is known

Actual Behavior

On Windows, transfer-encoding: chunked header is set.
On MacOS, no transfer-encoding header

Additional information

You can use as an endpoint to test what headers the PUT request is sent with.

If it matters, I’m testing on the prerelease

It’s not possible to use fetch headers{} or setRequestHeader, as transfer-encoding is considered unsafe, so you are forbidden from setting it manually

Thanks for reporting this potential bug. We will review this internally.

1 Like

Thanks for filing this; I’ve reached out to the internal engineering teams to see why the header is being set.

Confirmed this behavior is observed on PUT and POST requests

Hey! Any update on the issue?

We are facing the same issue with POST requests.

Will there be a fix around soon?

Fix is coming in XD 22. :slight_smile:


Thank you ! :smiley: