From 7816f43ca7dd246310b6acd2e6de12c7ffb7ddc5 Mon Sep 17 00:00:00 2001 From: Lucas Schumacher Date: Wed, 31 Jul 2024 13:31:44 -0400 Subject: [PATCH] Add Content-Type header to http response --- .gitignore | 2 ++ main.go | 1 + 2 files changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1586e95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +tmp + diff --git a/main.go b/main.go index 3fc3a45..957373c 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( ) func handlerFunc(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html; charset=utf8") fmt.Fprint(w, "

Welcome to my awesome site!

") }