[GH-ISSUE #963] remove Content-Length header cause dublicate #819

Closed
opened 2026-02-28 01:27:11 +03:00 by kerem · 1 comment
Owner

Originally created by @dontsovcmc on GitHub (Nov 13, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/963

WiFimanager Branch/Release:

  • Master
  • [x ] Development

Description

There is no need to add Header
server->sendHeader(FPSTR(HTTP_HEAD_CL), String(page.length()));

ESP8266WebServer.cpp will add it at 404 line:

void ESP8266WebServer::send(int code, const char* content_type, const String& content) {
    String header;
    // Can we asume the following?
    //if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET)
    //  _contentLength = CONTENT_LENGTH_UNKNOWN;
    _prepareHeader(header, code, content_type, content.length());    // here
    _currentClientWrite(header.c_str(), header.length());
    if(content.length())
      sendContent(content);
}
Originally created by @dontsovcmc on GitHub (Nov 13, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/963 **WiFimanager Branch/Release:** - [ ] Master - [x ] Development ### Description There is no need to add Header server->sendHeader(FPSTR(HTTP_HEAD_CL), String(page.length())); ESP8266WebServer.cpp will add it at 404 line: ``` void ESP8266WebServer::send(int code, const char* content_type, const String& content) { String header; // Can we asume the following? //if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET) // _contentLength = CONTENT_LENGTH_UNKNOWN; _prepareHeader(header, code, content_type, content.length()); // here _currentClientWrite(header.c_str(), header.length()); if(content.length()) sendContent(content); } ```
kerem 2026-02-28 01:27:11 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

This used to not be the case, I noticed this the other day also.

#940

<!-- gh-comment-id:553422722 --> @tablatronix commented on GitHub (Nov 13, 2019): This used to not be the case, I noticed this the other day also. #940
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#819
No description provided.