Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Nov 13, 2023
1 parent cf47490 commit 02c9d5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down

0 comments on commit 02c9d5d

Please sign in to comment.