Skip to content

Commit c08efb5

Browse files
dav1901earlephilhower
authored andcommitted
Adjust send_P to function the same as send (#5507)
1 parent 29bb7fc commit c08efb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content) {
419419
memccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type));
420420
_prepareHeader(header, code, (const char* )type, contentLength);
421421
_currentClientWrite(header.c_str(), header.length());
422-
sendContent_P(content);
422+
if (contentLength) {
423+
sendContent_P(content);
424+
}
423425
}
424426

425427
void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) {

0 commit comments

Comments
 (0)