mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1235] ERROR:The Content-Length header occurred more than once, at most one is allowed. #1054
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1054
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EgHubs on GitHub (Mar 30, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1235
Hardware
WiFimanager Branch/Release: Master
Esp8266
Hardware: ESP-12e
Core Version: 2.7.4
Description
I don't know if this is supposed to be posted here but when I try to make an HTTP request for the esp from my mobile application that I am developing while it's on AP mode and waiting for configuration i.e,
http://192.168.4.1I get the following error
The Content-Length header occurred more than once, at most one is allowed.though I can communicate it with google chrome as normal.
keep in mind that when I try to communicate to the esp after its configuration like
http://192.168.1.200it's all good with the same code from my flutter application.I don't know what happens in there, I was hoping for any help by your side
I'm using the latest library release
0.16I am developing a flutter application and making an HTTP request with the HTTP package
Module: NodeMcu
@EgHubs commented on GitHub (Mar 30, 2021):
What made me post it here is someone's comment on StackOverflow, he told me that
@tablatronix commented on GitHub (Mar 31, 2021):
I will take a look can you try with master? Also provide serial log and which page are you requesting?
@EgHubs commented on GitHub (Mar 31, 2021):
I am requesting the configuration page with the following link:
http://192.168.4.1/wifisave?s=myWifi&p=myPass&ip=192.168.1.203&gw=192.168.1.1&sn=255.255.255.0&email=new@test.com&pass=123456789&alarm=0and this is the log with the master branch (note: I am blocking the MCU from joining my router for testing):
it seems that the esp receives the HTTP request but it doesn't respond back or it responds back the Content-Length header incorrectly or something like that.
@tablatronix commented on GitHub (Mar 31, 2021):
Add it is only that page?
Does it do the same if not sending params as get arguments?
@EgHubs commented on GitHub (Mar 31, 2021):
Yes i get that error only in that page, i.e, when i try to make an http request to the esp after configuration with a link like
192.168.1.203/it's all good and okay and no error is catched@EgHubs commented on GitHub (Apr 4, 2021):
Sorry but I am still stuck in this error, any news? :)
@tablatronix commented on GitHub (Apr 4, 2021):
Sorry I have not had a chance to look at it.
@EgHubs commented on GitHub (Apr 4, 2021):
No problem at all for sure, hope you have soon 😄
@EgHubs commented on GitHub (Apr 13, 2021):
Here again, still no progress on this error.
when I tried to get the response from an API tester this is what I get
see I get Content-Length twice here, the server sends the Content-Length twice which is the error title that appears for me. i tried more than one site and I only get the Content-Length once
for example
keep in mind that the server receives the request but it responds back incorrectly.
I really hope that this makes it easier to solve the problem.
@tablatronix commented on GitHub (Apr 13, 2021):
crap I will look right now
@tablatronix commented on GitHub (Apr 13, 2021):
I can only assume that the webserver lib is sending this automatically.. I do not see anything in WM that would send this more than once, I will look into it further.
Can try the params page save, maybe for forms it auto sends it?
@tablatronix commented on GitHub (Apr 13, 2021):
I wonder if its the CORS on that page?
Maybe remove those and see what happens
@tablatronix commented on GitHub (Apr 13, 2021):
Yup its definitely sending it twice
@tablatronix commented on GitHub (Apr 13, 2021):
It seems content-length was added in 2015 maybe it was broken , no idea why this has never been noticed, I can remove them and test on older esp versions and see if it still works.
@tablatronix commented on GitHub (Apr 13, 2021):
It also seems to support httpclient requests now like the async lib, so that can also be changed, as add header already does dup checking
@tablatronix commented on GitHub (Apr 13, 2021):
Try it now, I tried old versions and its fine, so I am just gonna leave these out now
@EgHubs commented on GitHub (Apr 13, 2021):
Woooh !!, nice now it's working perfectly :), I am so happy that I did help to contribute to something important like that in this great library, I also have no idea why this error appeared to me, maybe some updates on the Flutter side refused this error.
I would suggest a quick fix update with a new version like 0.16.1 or something.
again thank you for helping me and thank you again for being such an active person in this library community and helping people.
@tablatronix commented on GitHub (Apr 13, 2021):
I would assume httpdclients should just ignore dup headers if they are identical, but who knows, technically it is against spec to send multiples
@EgHubs commented on GitHub (Apr 13, 2021):
Wil, based on the question I submitted on StackOverFlow someone submitted an issue requesting to ignore the error if the values are identical. like you are recommending.