summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-08-23 11:54:04 +0200
committerclsr <clsr@clsr.net>2017-08-23 11:54:04 +0200
commit2c4b2ba7c9668d76bae6b340882cce9f2c875806 (patch)
treea908a8d644d6e397949d1d97c075666665d7d9b6
parentf3d19bf6d4f868644aea9004ed774efad9ce8706 (diff)
downloadcn-http-2c4b2ba7c9668d76bae6b340882cce9f2c875806.tar.gz
cn-http-2c4b2ba7c9668d76bae6b340882cce9f2c875806.zip
Make ?raw serve CNM as text/plain
-rw-r--r--cnhttp.go3
1 files changed, 3 insertions, 0 deletions
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: