Skip to content

Wrong condition in HTTP version check routine (esp_http_server component) (IDFGH-13878) #14723

Closed
@valkuc

Description

@valkuc

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.3.1

Espressif SoC revision.

ESP32-C3

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

CMD

Development Kit.

Custom Board

Power Supply used.

USB

What is the expected behavior?

ESP HTTP server component should refuse to execute HTTP 1.0 request.

What is the actual behavior?

ESP HTTP server component executing HTTP 1.0 request.

Steps to reproduce.

Use curl to issue HTTP 1.0 request to ESP board:

curl -0 -v http://esp-board.local

Debug Logs.

No response

More Information.

There is an error in condition here

if ((parser->http_major != 1) && (parser->http_minor != 1)) {

Logical AND should be replaced with OR:

if ((parser->http_major != 1) || (parser->http_minor != 1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions