Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Nickobellic15X opened this issue Jul 12, 2022 · 2 comments · May be fixed by #150
Open

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

Nickobellic15X opened this issue Jul 12, 2022 · 2 comments · May be fixed by #150

Comments

@Nickobellic15X
Copy link

Nickobellic15X commented Jul 12, 2022

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
Copy link

Thanks for the info, this worked for me too.

@adamm
Copy link

adamm commented Nov 15, 2022

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 added a commit to adamm/esp32-wifi-manager that referenced this issue Nov 15, 2022
Setting CONFIG_HTTPD_MAX_URI_LEN=1024 in your project's sdkconfig.defaults file will ensure the captive portal works on more devices, like Android.

Also applied the setting as under the examples.

Fixes tonyp7#147
MagicSmokeSolutions added a commit to MagicSmokeSolutions/esp32-wifi-manager that referenced this issue Jun 4, 2023
Setting CONFIG_HTTPD_MAX_URI_LEN=1024 in your project's sdkconfig.defaults file will ensure the captive portal works on more devices, like Android.

Also applied the setting as under the examples.

Fixes tonyp7#147

Authored-by: Adam McDaniel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants