|
17 | 17 |
|
18 | 18 | #include "assets_index_html.h" |
19 | 19 | #include "assets_cache_appcache.h" |
| 20 | +#include "assets_favicon_svg.h" |
| 21 | +#include "assets_icon_png.h" |
20 | 22 |
|
21 | 23 | #include "pldmgr.h" |
22 | 24 |
|
@@ -720,9 +722,10 @@ static enum MHD_Result on_request(void *cls, struct MHD_Connection *conn, |
720 | 722 | } |
721 | 723 | } |
722 | 724 |
|
723 | | - /* Only log significant requests, not pollers like /log */ |
| 725 | + /* Only log significant requests, not pollers like /log or static assets */ |
724 | 726 | if (strcmp(url, ROUTE_LOG) != 0 && strcmp(url, ROUTE_INDEX) != 0 && |
725 | | - strcmp(url, ROUTE_INDEX_HTML) != 0) { |
| 727 | + strcmp(url, ROUTE_INDEX_HTML) != 0 && strcmp(url, "/favicon.svg") != 0 && |
| 728 | + strcmp(url, "/icon.png") != 0) { |
726 | 729 | pldmgr_log("[PLDMGR] Request: %s %s\n", method, url); |
727 | 730 | } |
728 | 731 |
|
@@ -801,6 +804,18 @@ static enum MHD_Result on_request(void *cls, struct MHD_Connection *conn, |
801 | 804 | MHD_RESPMEM_PERSISTENT); |
802 | 805 | MHD_add_response_header(resp, "Content-Type", "text/cache-manifest"); |
803 | 806 | MHD_add_response_header(resp, "Cache-Control", "no-cache, must-revalidate"); |
| 807 | + } else if (strcmp(url, "/favicon.svg") == 0) { |
| 808 | + resp = MHD_create_response_from_buffer(assets_favicon_svg_len, |
| 809 | + (void *)assets_favicon_svg, |
| 810 | + MHD_RESPMEM_PERSISTENT); |
| 811 | + MHD_add_response_header(resp, "Content-Type", "image/svg+xml"); |
| 812 | + MHD_add_response_header(resp, "Cache-Control", "max-age=604800"); |
| 813 | + } else if (strcmp(url, "/icon.png") == 0) { |
| 814 | + resp = MHD_create_response_from_buffer(assets_icon_png_len, |
| 815 | + (void *)assets_icon_png, |
| 816 | + MHD_RESPMEM_PERSISTENT); |
| 817 | + MHD_add_response_header(resp, "Content-Type", "image/png"); |
| 818 | + MHD_add_response_header(resp, "Cache-Control", "max-age=604800"); |
804 | 819 | } else if (strcmp(url, ROUTE_CHECK) == 0) { |
805 | 820 |
|
806 | 821 |
|
|
0 commit comments