Add Content-Type header to http response

This commit is contained in:
Lucas Schumacher 2024-07-31 13:31:44 -04:00
parent d556efa15b
commit 7816f43ca7
2 changed files with 3 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
tmp

View File

@ -6,6 +6,7 @@ import (
) )
func handlerFunc(w http.ResponseWriter, r *http.Request) { func handlerFunc(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf8")
fmt.Fprint(w, "<h1>Welcome to my awesome site!</h1>") fmt.Fprint(w, "<h1>Welcome to my awesome site!</h1>")
} }