Skip to content

Commit

Permalink
Merge branch 'feature/add_support_for_http_1.0_requests_v5.4' into 'r…
Browse files Browse the repository at this point in the history
…elease/v5.4'

feat(esp_http_server): add support to handle HTTP 1.0 requests (v5.4)

See merge request espressif/esp-idf!35659
  • Loading branch information
AdityaHPatwardhan committed Dec 25, 2024
2 parents 25a1ad7 + 4026e64 commit 0fae01c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/esp_http_server/include/esp_http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ typedef enum {
*/
HTTPD_501_METHOD_NOT_IMPLEMENTED,

/* When HTTP version is not 1.1 */
/* When HTTP version is not 1.1 or 1.0*/
HTTPD_505_VERSION_NOT_SUPPORTED,

/* Returned when http_parser halts parsing due to incorrect
Expand Down
4 changes: 2 additions & 2 deletions components/esp_http_server/src/httpd_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static esp_err_t verify_url (http_parser *parser)
strlcpy((char *)r->uri, at, (length + 1));
ESP_LOGD(TAG, LOG_FMT("received URI = %s"), r->uri);

/* Make sure version is HTTP/1.1 */
if (!((parser->http_major == 1) && (parser->http_minor == 1))) {
/* Make sure version is HTTP/1.1 or HTTP/1.0 (legacy compliance purpose) */
if (!((parser->http_major == 1) && ((parser->http_minor == 0) || (parser->http_minor == 1)))) {
ESP_LOGW(TAG, LOG_FMT("unsupported HTTP version = %d.%d"),
parser->http_major, parser->http_minor);
parser_data->error = HTTPD_505_VERSION_NOT_SUPPORTED;
Expand Down

0 comments on commit 0fae01c

Please sign in to comment.