Aktualizace na verzi 2.6.1

This commit is contained in:
2024-02-04 12:02:36 +01:00
parent 37a23ac99e
commit 99ed8af3ff
6 changed files with 31 additions and 12 deletions

View File

@ -798,7 +798,7 @@ void AsyncWebSocketClient::binary(const __FlashStringHelper *data, size_t len)
IPAddress AsyncWebSocketClient::remoteIP() const
{
if (!_client)
return IPAddress((uint32_t)0);
return IPAddress((uint32_t)0U);
return _client->remoteIP();
}

View File

@ -40,9 +40,9 @@
#error Platform not supported
#endif
#define ASYNCWEBSERVER_VERSION "2.5.1"
#define ASYNCWEBSERVER_VERSION "2.6.1"
#define ASYNCWEBSERVER_VERSION_MAJOR 2
#define ASYNCWEBSERVER_VERSION_MINOR 5
#define ASYNCWEBSERVER_VERSION_MINOR 6
#define ASYNCWEBSERVER_VERSION_REVISION 1
#define ASYNCWEBSERVER_FORK_mathieucarbou

View File

@ -58,7 +58,7 @@ AsyncStaticWebHandler& AsyncStaticWebHandler::setCacheControl(const char* cache_
}
AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(const char* last_modified){
_last_modified = String(last_modified);
_last_modified = last_modified;
return *this;
}
@ -205,7 +205,9 @@ void AsyncStaticWebHandler::handleRequest(AsyncWebServerRequest *request)
return request->requestAuthentication();
if (request->_tempFile == true) {
String etag = String(request->_tempFile.size());
time_t lw = request->_tempFile.getLastWrite(); // get last file mod time (if supported by FS)
if (lw) setLastModified(gmtime(&lw));
String etag(lw ? lw : request->_tempFile.size()); // set etag to lastmod timestamp if available, otherwise to size
if (_last_modified.length() && _last_modified == request->header(F("If-Modified-Since"))) {
request->_tempFile.close();
request->send(304); // Not modified