From 2c4b2ba7c9668d76bae6b340882cce9f2c875806 Mon Sep 17 00:00:00 2001 From: clsr Date: Wed, 23 Aug 2017 11:54:04 +0200 Subject: Make ?raw serve CNM as text/plain --- cnhttp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cnhttp.go b/cnhttp.go index ab251af..3e3f431 100644 --- a/cnhttp.go +++ b/cnhttp.go @@ -199,6 +199,9 @@ func (srv *server) cnpToWeb(w http.ResponseWriter, r *http.Request, req *cnp.Req if !raw && resp.Type() == "text/cnm" { srv.cnpCNMToHTML(w, r, req, resp) } else { + if resp.Type() == "text/cnm" { + w.Header().Set("Content-Type", "text/plain") + } io.Copy(w, resp.Body) } case cnp.IntentNotModified: -- cgit