-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
httpd_req_get_hdr_value_str() fails to find a field key after an empty value (IDFGH-1539) #3803
Comments
github-actions
bot
changed the title
httpd_req_get_hdr_value_str() fails to find a field key after an empty value
httpd_req_get_hdr_value_str() fails to find a field key after an empty value (IDFGH-1539)
Jul 20, 2019
Thank you very much! |
yappy
added a commit
to yappy/DollsWatch
that referenced
this issue
Jul 22, 2019
Any update on this? |
igrr
pushed a commit
that referenced
this issue
Sep 16, 2019
This MR is intended to fix incorrect parsing of HTTP requests when empty header values are present. The issue is was due to asymmetric behavior of `http_parser` library, which in case of: * non-empty header values : invokes callbacks with the pointer to the start of a value * empty header values : invokes callbacks with pointer to the start of next header or section Since HTTP server relies on this pointer (along with length of the value) to locate the end of a value, and replace the line terminators (CRLFs) with null characters, the second case needed to be handled correctly. Closes IDFGH-1539 Closes #3803 Backports !5663
igrr
pushed a commit
that referenced
this issue
Sep 16, 2019
This MR is intended to fix incorrect parsing of HTTP requests when empty header values are present. The issue is was due to asymmetric behavior of `http_parser` library, which in case of: non-empty header values : invokes callbacks with the pointer to the start of a value empty header values : invokes callbacks with pointer to the start of next header or section Since HTTP server relies on this pointer (along with length of the value) to locate the end of a value, and replace the line terminators (CRLFs) with null characters, the second case needed to be handled correctly. Closes IDFGH-1539 Closes #3803
igrr
pushed a commit
that referenced
this issue
Sep 21, 2019
This MR is intended to fix incorrect parsing of HTTP requests when empty header values are present. The issue is was due to asymmetric behavior of `http_parser` library, which in case of: non-empty header values : invokes callbacks with the pointer to the start of a value empty header values : invokes callbacks with pointer to the start of next header or section Since HTTP server relies on this pointer (along with length of the value) to locate the end of a value, and replace the line terminators (CRLFs) with null characters, the second case needed to be handled correctly. Closes IDFGH-1539 Closes #3803
loganfin
pushed a commit
to Lumenaries/esp_http_server
that referenced
this issue
Apr 23, 2024
This MR is intended to fix incorrect parsing of HTTP requests when empty header values are present. The issue is was due to asymmetric behavior of `http_parser` library, which in case of: non-empty header values : invokes callbacks with the pointer to the start of a value empty header values : invokes callbacks with pointer to the start of next header or section Since HTTP server relies on this pointer (along with length of the value) to locate the end of a value, and replace the line terminators (CRLFs) with null characters, the second case needed to be handled correctly. Closes IDFGH-1539 Closes espressif/esp-idf#3803
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
git describe --tags
to find it):v3.2
xtensa-esp32-elf-gcc --version
to find it):1.22.0-80-g6c4433a
Problem Description
When there is an empty value entry in HTTP header, httpd_req_get_hdr_value_str() returns ESP_ERR_NOT_FOUND.
Expected Behavior
httpd_req_get_hdr_value_str() succeeds and returns its value. (index.lua)
Actual Behavior
httpd_req_get_hdr_value_str() returns ESP_ERR_NOT_FOUND.
Steps to repropduce
Code to reproduce this issue
The text was updated successfully, but these errors were encountered: