-
Notifications
You must be signed in to change notification settings - Fork 239
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
embedded:network/http/client requires headers in lower case #1218
Comments
The implementation certainly expects lowercase header names on input and generates lowercase headers names on output. When used with name = name.toLowerCase(); This allows the script to control the case of the headers sent, in case it matters (it shouldn't).. Alternatively, the I'll commit that so no one else has to trip over this. Using What do you think? |
Also.... the HTTP 1.1 specification states:
I think that means that the chunked check needs to be updated as well (not that anyone uses "CHUNKED"): if ("chunked" === item.value[1].toLowerCase()) |
Fix committed. Closing. (If problem persists, please reopen.) |
Build environment: Linux
Moddable SDK version: idf-v5 branch
Target device: esp32-c3
Description
Looking at https://419.ecma-international.org/#-20-http-client-class-pattern I do not see the requirement that the headers passed to the
request
method be all lower case. I passed["Content-Length": ...]
and this caused no onWritable callback due to the lower-case equality check in /~https://github.com/Moddable-OpenSource/moddable/blob/public/examples/io/tcp/httpclient/httpclient.js#L343 . Note the same issue for transfer-encoding.Expected behavior
I expected a case-insensitive comparison or a sentence in the spec to state that the headers must be all lower-case. (I bet the latter is there somewhere and I just haven't seen it....)
The text was updated successfully, but these errors were encountered: