diff options
author | clsr <clsr@clsr.net> | 2017-08-23 11:54:04 +0200 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2017-08-23 11:54:04 +0200 |
commit | 2c4b2ba7c9668d76bae6b340882cce9f2c875806 (patch) | |
tree | a908a8d644d6e397949d1d97c075666665d7d9b6 | |
parent | f3d19bf6d4f868644aea9004ed774efad9ce8706 (diff) | |
download | cn-http-2c4b2ba7c9668d76bae6b340882cce9f2c875806.tar.gz cn-http-2c4b2ba7c9668d76bae6b340882cce9f2c875806.zip |
Make ?raw serve CNM as text/plain
-rw-r--r-- | cnhttp.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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: |