tonyp7 / esp32-wifi-manager

Captive Portal for ESP32 that can connect to a saved wireless network or start an access point where you can connect to existing wifis.
MIT License
684 stars 222 forks source link

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

Open Nickobellic15X opened 2 years ago

Nickobellic15X commented 2 years ago

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

riccardomaestri commented 2 years ago

Thanks for the info, this worked for me too.

adamm commented 2 years ago

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 :)