From 02c9d5d07f585ff88590fdbc7db711f7ce665a9f Mon Sep 17 00:00:00 2001 From: Rodrigo Delduca <46259+skhaz@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:36:48 -0300 Subject: [PATCH] Work in progress --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index b716dc3..893de2f 100644 --- a/main.go +++ b/main.go @@ -193,6 +193,12 @@ func getRuntimeFromURL(urlPath string) string { return runtime } +func faviconHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "public, max-age=31536000") + w.Header().Set("Content-Type", "image/x-icon") + w.Write([]byte{}) +} + func rootHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") w.Write(html) @@ -206,6 +212,8 @@ func main() { wasmHandler(w, r) } else if strings.HasSuffix(r.URL.Path, ".zip") { zipHandler(w, r) + } else if strings.HasSuffix(r.URL.Path, ".ico") { + faviconHandler(w, r) } else { rootHandler(w, r) }