Merge branch 'bugfix/update_condition_to_verify_http_version_v5.0' into 'release/v5.0'

fix(esp_http_server): updated condition to verify http version (v5.0)

See merge request espressif/esp-idf!34638
This commit is contained in:
Aditya Patwardhan
2024-11-06 16:40:32 +08:00

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -83,7 +83,7 @@ static esp_err_t verify_url (http_parser *parser)
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)) {
if (!((parser->http_major == 1) && (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;