mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
temporarly fix for handling PGM_P content_type properly in ESP8266WebServer::send_P() functions
This commit is contained in:
@ -164,14 +164,18 @@ void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String header;
|
String header;
|
||||||
_prepareHeader(header, code, String(FPSTR(content_type)).c_str(), contentLength);
|
char type[64];
|
||||||
|
memccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type));
|
||||||
|
_prepareHeader(header, code, (const char* )type, contentLength);
|
||||||
sendContent(header);
|
sendContent(header);
|
||||||
sendContent_P(content);
|
sendContent_P(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) {
|
void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) {
|
||||||
String header;
|
String header;
|
||||||
_prepareHeader(header, code, String(FPSTR(content_type)).c_str(), contentLength);
|
char type[64];
|
||||||
|
memccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type));
|
||||||
|
_prepareHeader(header, code, (const char* )type, contentLength);
|
||||||
sendContent(header);
|
sendContent(header);
|
||||||
sendContent_P(content, contentLength);
|
sendContent_P(content, contentLength);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user