1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-07 06:01:35 +03:00

Handle HEAD requests for static files correctly (#6837)

* Handle HEAD requests for static files correctly

* Handle HEAD requests for static files correctly
This commit is contained in:
Matthias Hertel
2019-12-04 18:23:25 +01:00
committed by david gauchard
parent 5aefed2f4b
commit a738884387
2 changed files with 15 additions and 3 deletions

View File

@ -76,7 +76,7 @@ public:
}
bool canHandle(HTTPMethod requestMethod, String requestUri) override {
if (requestMethod != HTTP_GET)
if ((requestMethod != HTTP_GET) && (requestMethod != HTTP_HEAD))
return false;
if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri))
@ -125,7 +125,7 @@ public:
if (_cache_header.length() != 0)
server.sendHeader("Cache-Control", _cache_header);
server.streamFile(f, contentType);
server.streamFile(f, contentType, requestMethod);
return true;
}