esp32-wifi-manager icon indicating copy to clipboard operation
esp32-wifi-manager copied to clipboard

Add Documentation for "Header Fields are too long for the server to interpret" error

Open Nickobellic15X opened this issue 1 year ago • 2 comments

Feature request is related to a problem, not sure if it's intended by design, here it is:

When running the "default_demo" example, the code compiles and executes fine, but when trying to connect to the AP the ESP starts, my phone (Android 12) after connecting to the AP mentions that the "Header Fields are too long for the server to interpret", this seems like a common issue in newer phones, I've encountered this issue in Android 11, and iOS 15.

Possible Quick Fix for now:

The solution I found to be working is mentioned here.

In my opinion, this solution should be included in the official documentation.

Steps for mitigating the issue:

  1. Go to the project directory in CMD (or terminal of your choice with ESP-IDF).
  2. Open Menuconfig idf.py menuconfig
  3. Go To Componenet config -> HTTP Server -> Max HTTP URI Length: Change the default value from 512 to 1024. image

Thank you, Nikhil

Nickobellic15X avatar Jul 12 '22 11:07 Nickobellic15X

Thanks for the info, this worked for me too.

riccardomaestri avatar Sep 24 '22 10:09 riccardomaestri

Interesting ... I initially tested esp32-wifi-manager in my application using MacOS's captive portal/registration, and never encountered the problem.

Tried it using my Android 11 phone today and do encounter it. I guess Android's way of handling this creates a URI >512 bytes, but mac's does not. Strange.

Regardless, this issue can be worked around for eveyrone trying the demo by modify the sdkconfig.defaults to include the larger config value, but the docs should be updated because the same thing will be needed on first-party apps that use this module.

diff --git a/examples/default_demo/sdkconfig.defaults b/examples/default_demo/sdkconfig.defaults
index f44c06f..cac9639 100644
--- a/examples/default_demo/sdkconfig.defaults
+++ b/examples/default_demo/sdkconfig.defaults
@@ -1 +1,2 @@
 CONFIG_LWIP_IPV6=y
+CONFIG_HTTPD_MAX_URI_LEN=1024

I can submit a PR that has this and some documentation :)

adamm avatar Nov 15 '22 19:11 adamm