aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/http/http.go')
-rw-r--r--src/net/http/http.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/http/http.go b/src/net/http/http.go
index b95ca89f40..8bcd49e3b0 100644
--- a/src/net/http/http.go
+++ b/src/net/http/http.go
@@ -59,6 +59,17 @@ func isASCII(s string) bool {
return true
}
+// stringContainsCTLByte reports whether s contains any ASCII control character.
+func stringContainsCTLByte(s string) bool {
+ for i := 0; i < len(s); i++ {
+ b := s[i]
+ if b < ' ' || b == 0x7f {
+ return true
+ }
+ }
+ return false
+}
+
func hexEscapeNonASCII(s string) string {
newLen := 0
for i := 0; i < len(s); i++ {