-
Notifications
You must be signed in to change notification settings - Fork 13.3k
CaptivePortalAdvanced example doesn't call setContentLength #1718
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
Comments
If you intend to send more than once, you need to supply content length or let WebServer know that it is undefined. So before calling |
which version you are working with? |
Sorry, that was a typo — the function is called I'm using the latest git version, but the function should be present both in latest stable (2.1.0) and staging (2.1.0-rc2). |
that works, thx! maybe you should update the CaptivePortalAdvanced Example accordingly. |
This is needed since when the content-length header is not sent the clients will wait for data anyways. Sending a content length of zero will tell the client not to expect any content and it will close the connection immediately.
Basic Infos
Hardware
Hardware: ESP-12E
Core Version: 2.1.0
Description
this returns an empty response since 2.1.0:
ESP8266WebServer webServer(80);
webServer.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
webServer.sendHeader("Pragma", "no-cache");
webServer.sendHeader("Expires", "-1");
webServer.send(200, "text/html", "");
webServer.sendContent(
""
""
"
My HTML
""
);
webServer.client().stop();
but this works:
ESP8266WebServer webServer(80);
webServer.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
webServer.sendHeader("Pragma", "no-cache");
webServer.sendHeader("Expires", "-1");
webServer.send(200, "text/html", "
My HTML
Settings in IDE
Module: NodeMCU 1.0
Flash Size: 4MB/
CPU Frequency: 80Mhz
Flash Mode: ?
Flash Frequency: ?
Upload Using: SERIAL
Reset Method: ?
Sketch
see above
The text was updated successfully, but these errors were encountered: