http icon indicating copy to clipboard operation
http copied to clipboard

Changed preserveHeaderCase from false to true for request headers.

Open Mohammed3194 opened this issue 1 year ago • 2 comments

I have changed preserveHeaderCase for headers from false to true. The custom headers defined in the back end server were not accepting the case-sensitive header (X-Auth-Signature). The result was that I couldn't make API requests and was getting 401 unauthorized responses all the time.

Once after setting preserveHeaderCase to true API has started working. Consider this change or is that it is possible to change preserveHeaderCase from post/get/put/delete methods, where actual API requests are made.

This is a problem that most others are experiencing as well - #Reference Link

@brianquinlan, @kevmoo, @mit-mit, @natebosch, @devoncarew, @osa1, @Hamaad-Siddiqui, @aam, @guyluz11

Thank You

Mohammed3194 avatar Sep 30 '22 08:09 Mohammed3194

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Sep 30 '22 08:09 google-cla[bot]

I'm not sure if we need to wait to release this as a major version change with other breaking changes.

https://github.com/dart-lang/http/issues/609

natebosch avatar Sep 30 '22 17:09 natebosch

Would this change cause a semantic difference between browser_client and io_client?

brianquinlan avatar Oct 27 '22 20:10 brianquinlan

Would this change cause a semantic difference between browser_client and io_client?

I don't think so. I think there is currently a semantic difference and this would remove it. AFAIK the browser does not change the case of headers.

natebosch avatar Oct 28 '22 00:10 natebosch

This change does break some tests, but not many IIRC.

natebosch avatar Oct 28 '22 00:10 natebosch