summaryrefslogtreecommitdiffstats
path: root/cnhttp.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2021-02-05 08:23:30 +0000
committerclsr <clsr@clsr.net>2021-02-05 08:23:30 +0000
commitc0edbdbdd6ab164fdbbd157c2e0fa10663d26c36 (patch)
tree70d0fc9b2488f6a0cff16c7c6c634889326f06f4 /cnhttp.go
parent605b2f39dfa8c45fc3271c77f6fe37a9c2af9305 (diff)
downloadcn-http-c0edbdbdd6ab164fdbbd157c2e0fa10663d26c36.tar.gz
cn-http-c0edbdbdd6ab164fdbbd157c2e0fa10663d26c36.zip
Fix Content-Disposition filename text filteringHEADv0.2.3master
Diffstat (limited to 'cnhttp.go')
-rw-r--r--cnhttp.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cnhttp.go b/cnhttp.go
index f9f9a30..b1e88db 100644
--- a/cnhttp.go
+++ b/cnhttp.go
@@ -1,4 +1,4 @@
-package main
+package main // import "contnet.org/util/cn-http"
import (
"bytes"
@@ -274,7 +274,7 @@ func (srv *server) cnpParamsToHTTP(w http.ResponseWriter, resp *cnp.Response) {
}
if n := resp.Name(); n != "" {
w.Header().Set("Content-Disposition", "inline; filename=\""+strings.Map(func(r rune) rune {
- if r < ' ' || r == ' ' || r == '\'' { // filter out nulls, control codes, newlines and quotes
+ if r < ' ' || r == '"' || r == '\'' { // filter out nulls, control codes, newlines and quotes
return -1
}
return r