cerrado @ 02614b3781f6acdfc6df0e7b07d856b2779c4ac7

 1package ext
 2
 3import "net/http"
 4
 5type ContentType = string
 6
 7const (
 8	TextHTML ContentType = "text/html"
 9)
10
11func Html(next func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) {
12	return func(w http.ResponseWriter, r *http.Request) {
13		next(w, r)
14	}
15}
16
17func SetHTML(w http.ResponseWriter) {
18	SetMIME(w, TextHTML)
19
20}
21
22func SetMIME(w http.ResponseWriter, mime ContentType) {
23	w.Header().Add("Content-Type", mime)
24}