Add Content-Type header to http response
This commit is contained in:
parent
d556efa15b
commit
7816f43ca7
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
tmp
|
||||||
|
|
||||||
1
main.go
1
main.go
@ -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>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user