diff --git a/components/esp_http_server/src/httpd_parse.c b/components/esp_http_server/src/httpd_parse.c index aceb832f21db..7e69890964fd 100644 --- a/components/esp_http_server/src/httpd_parse.c +++ b/components/esp_http_server/src/httpd_parse.c @@ -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 */ @@ -90,7 +90,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; @@ -110,7 +110,7 @@ static esp_err_t verify_url (http_parser *parser) } /* http_parser callback on finding url in HTTP request - * Will be invoked ATLEAST once every packet + * Will be invoked AT LEAST once every packet */ static esp_err_t cb_url(http_parser *parser, const char *at, size_t length) @@ -195,7 +195,7 @@ static size_t continue_parsing(http_parser *parser, size_t length) } /* http_parser callback on header field in HTTP request - * May be invoked ATLEAST once every header field + * May be invoked AT LEAST once every header field */ static esp_err_t cb_header_field(http_parser *parser, const char *at, size_t length) { @@ -254,7 +254,7 @@ static esp_err_t cb_header_field(http_parser *parser, const char *at, size_t len } /* http_parser callback on header value in HTTP request. - * May be invoked ATLEAST once every header value + * May be invoked AT LEAST once every header value */ static esp_err_t cb_header_value(http_parser *parser, const char *at, size_t length) {