Add Server to HTTP header (#10831)

This commit is contained in:
Theo Arends 2021-02-04 18:06:34 +01:00
parent d5542b1a66
commit 607654297b
2 changed files with 7 additions and 0 deletions

View File

@ -742,7 +742,11 @@ String GetDeviceHardware(void)
}
#endif // ESP8266
#ifdef ESP32
#if CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2
strcpy_P(buff, PSTR("ESP32-S2"));
#else
strcpy_P(buff, PSTR("ESP32"));
#endif // CONFIG_IDF_TARGET_ESP32S2
#endif // ESP32
return String(buff);
}

View File

@ -573,6 +573,9 @@ void HttpHeaderCors(void)
void WSHeaderSend(void)
{
char server[32];
snprintf_P(server, sizeof(server), PSTR("Tasmota/%s (%s)"), TasmotaGlobal.version, GetDeviceHardware().c_str());
Webserver->sendHeader(F("Server"), server);
Webserver->sendHeader(F("Cache-Control"), F("no-cache, no-store, must-revalidate"));
Webserver->sendHeader(F("Pragma"), F("no-cache"));
Webserver->sendHeader(F("Expires"), F("-1"));