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

Bug: The header field name is case-insensitive but is not processed as such. #672

Closed
yunjova opened this issue Mar 29, 2016 · 2 comments · Fixed by #681
Closed

Bug: The header field name is case-insensitive but is not processed as such. #672

yunjova opened this issue Mar 29, 2016 · 2 comments · Fixed by #681

Comments

@yunjova
Copy link

yunjova commented Mar 29, 2016

There is a bug in the file: "Sming/Sming/SmingCore/Network/HttpRequest.cpp".

The header field name is case-insensitive according to:
https://tools.ietf.org/html/rfc7230
...
3.2. Header Fields
Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace.

...

So in: "Sming/Sming/SmingCore/Network/HttpRequest.cpp"
the function:
String HttpRequest::getHeader(String headerName, String defaultValue /* = "" */)
must do a case-insensitive compare.

Example: It should accept Content-Type: but also Content-type: (lowercase t in -type).

@patrickjahns
Copy link
Member

Good catch. The proposed solution is not complete. There are more parts of the code that need to be addressed in order to enable case insensitive parsing and processing

I will provide a patch towards #622 and #631

@patrickjahns
Copy link
Member

Fix provided - please see #681 and test it

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 a pull request may close this issue.

2 participants