8000 Default value for sdkconfig parm CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 too small in Arduino · Issue #5969 · espressif/arduino-esp32 · GitHub
[go: up one dir, main page]

Skip to content
Default value for sdkconfig parm CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 too small in Arduino #5969
Closed
@craigdetter

Description

@craigdetter

Using a form method="post" from a web page to the ESP32 device (using SoftAP, and web_server built from file_server example).
<form id="setup-form" action="/domain/setup_form_content" method="post"> ... </form>

Causes error condition with message:
"Header fields are too long for server to interpret"

The header length of a Wireshark trace (see below) shows 554 byte long header being sent by Google Chrome.

Hardware:

Board: ESP32 Adafruit Huzzah32
Core Installation version: v5.0-dev-553-g42cce06704-dirty
IDE name: Arduino IDE or VSCode
Flash Frequency: N/A
PSRAM enabled: N/A
Upload Speed: N/A
Computer OS: Mac OSX Catalina latest with Google Chrome latest version

Description:

Describe your problem here

The default in build for the sdkconfig configuration parameter is:
CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 (bytes).
It needs to be set at least 768 bytes, but 1024 would be better.

This is a problem for all development platforms and ESP32 targets, but a real burden for customers using Arduino because the binary isn't easy to recompile.

On Google Chrome latest version running on MacOS on the latest Catalina OS:
using Wireshark trace - shows the "post" header is 554 bytes long (not incl. CR/LF)

Host: 192.168.4.1\r\n
Connection: keep-alive\r\n
Content-Length: 95\r\n
Cache-Control: max-age=0\r\n
Upgrade-Insecure-Requests: 1\r\n
Origin: http://192.168.4.1\r\n
Content-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n
Referer: http://192.168.4.1/\r\n
Accept-Encoding: gzip, deflate\r\n
Accept-Language: en-US,en;q=0.9,pl;q=0.8\r\n
\r\n

On Chrome "get" header is at least 478 bytes ....

_Host: 192.168.4.1\r\n
Connection: keep-alive\r\n
Upgrade-Insecure-Requests: 1\r\n
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n
Referer: http://192.168.4.1/\r\n
Accept-Encoding: gzip, deflate\r\n
Accept-Language: en-US,en;q=0.9,pl;q=0.8\r\n
\r\n

Wireshark Trace - Packet 218 ("post" from Chrome to ESP32):
Packet 218 from Wireshark trace

Wireshark Trace - Packet 219 (response from ESP32 to Chrome):
Packet 219 from Wireshartk trace

_

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

      0