(next http.Handler)
| 61 | } |
| 62 | |
| 63 | func TextHTMLMiddleware(next http.Handler) http.Handler { |
| 64 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 65 | w.Header().Set("Content-Type", "text/html; charset=utf-8") |
| 66 | next.ServeHTTP(w, r) |
| 67 | }) |
| 68 | } |
| 69 | |
| 70 | // get the Nonce from the context, it is a struct called Nonces, |
| 71 | // so we can get the nonce we need by the key, i.e. HtmxNonce |