Skip to content

Commit

Permalink
mathieucarbou/ESP Async WebServer @ 3.0.2
Browse files Browse the repository at this point in the history
(cherry picked from commit ec2bcba48f61ab7cd6a124b5b0b23322a3c48674)
  • Loading branch information
mathieucarbou committed Jun 27, 2024
1 parent 026d048 commit f0effdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ lib_deps =
olikraus/U8g2 @ 2.35.19
robtillaart/CRC @ 1.0.3
mathieucarbou/Async TCP @ 3.1.4
mathieucarbou/ESP Async WebServer @ 2.10.8
mathieucarbou/ESP Async WebServer @ 3.0.2
mathieucarbou/MycilaConfig @ 3.0.1
mathieucarbou/MycilaDS18 @ 3.0.2
mathieucarbou/MycilaESPConnect @ 4.3.3
mathieucarbou/MycilaESPConnect @ 4.4.0
mathieucarbou/MycilaEasyDisplay @ 3.0.1
mathieucarbou/MycilaHADiscovery @ 2.2.1
mathieucarbou/MycilaJSY @ 9.0.8
Expand Down Expand Up @@ -137,7 +137,9 @@ build_flags =
[oss]
build_flags = -D APP_MODEL_OSS
lib_deps =
mathieucarbou/WebSerialLite @ 6.0.0
; mathieucarbou/WebSerialLite @ 6.1.0
; ayushsharma82/WebSerial @ 2.0.2
https://github.com/mathieucarbou/ayushsharma82-WebSerial#dev
; ayushsharma82/ElegantOTA @ 3.1.1
https://github.com/mathieucarbou/ayushsharma82-ElegantOTA#dev
; ayushsharma82/ESP-DASH @ 4.0.4
Expand Down
6 changes: 3 additions & 3 deletions src/init/HTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Mycila::Task initWebTask("Init Web", [](void* params) {
webServer.rewrite("/", "/dashboard").setFilter([](AsyncWebServerRequest* request) { return ESPConnect.getState() != ESPConnectState::PORTAL_STARTED; });

webServer.on("/logo-icon", HTTP_GET, [](AsyncWebServerRequest* request) {
AsyncWebServerResponse* response = request->beginResponse_P(200, "image/png", logo_icon_png_gz_start, logo_icon_png_gz_end - logo_icon_png_gz_start);
AsyncWebServerResponse* response = request->beginResponse(200, "image/png", logo_icon_png_gz_start, logo_icon_png_gz_end - logo_icon_png_gz_start);
response->addHeader("Content-Encoding", "gzip");
response->addHeader("Cache-Control", "public, max-age=900");
request->send(response);
});

webServer.on("/logo", HTTP_GET, [](AsyncWebServerRequest* request) {
AsyncWebServerResponse* response = request->beginResponse_P(200, "image/png", logo_png_gz_start, logo_png_gz_end - logo_png_gz_start);
AsyncWebServerResponse* response = request->beginResponse(200, "image/png", logo_png_gz_start, logo_png_gz_end - logo_png_gz_start);
response->addHeader("Content-Encoding", "gzip");
response->addHeader("Cache-Control", "public, max-age=900");
request->send(response);
Expand All @@ -46,7 +46,7 @@ Mycila::Task initWebTask("Init Web", [](void* params) {

webServer
.on("/config", HTTP_GET, [](AsyncWebServerRequest* request) {
AsyncWebServerResponse* response = request->beginResponse_P(200, "text/html", config_html_gz_start, config_html_gz_end - config_html_gz_start);
AsyncWebServerResponse* response = request->beginResponse(200, "text/html", config_html_gz_start, config_html_gz_end - config_html_gz_start);
response->addHeader("Content-Encoding", "gzip");
request->send(response);
})
Expand Down

0 comments on commit f0effdb

Please sign in to comment.