Skip to content

Commit

Permalink
Fix duplicate response headers #834
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Dec 14, 2024
1 parent 62154fb commit 78a3b38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sys/svc/hasp_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,18 @@ static void webSendFooter()
#endif
}

static void http_send_cache_header(int size, int age = 3600)
static void http_send_cache_header(int age = 3600)
{
webServer.sendHeader("Content-Length", (String)(size));
webServer.sendHeader("Cache-Control", (String)(F("public, max-age=")) + (String)(age));
}

static int http_send_cached(int statuscode, const char* contenttype, const char* data, size_t size, int age = 3600)
{
http_send_cache_header(size, age);
http_send_cache_header(age);
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
webServer.send_P(statuscode, contenttype, data, size);
#else
webServer.sendHeader("Content-Length", (String)(size));
webServer.send(statuscode, contenttype, data);
#endif
return statuscode;
Expand Down

0 comments on commit 78a3b38

Please sign in to comment.