summaryrefslogtreecommitdiff
path: root/libgo/go/net/textproto/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/textproto/reader.go')
-rw-r--r--libgo/go/net/textproto/reader.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/libgo/go/net/textproto/reader.go b/libgo/go/net/textproto/reader.go
index 56ece5b087c..b0c07413c19 100644
--- a/libgo/go/net/textproto/reader.go
+++ b/libgo/go/net/textproto/reader.go
@@ -574,13 +574,10 @@ func canonicalMIMEHeaderKey(a []byte) string {
// and upper case after each dash.
// (Host, User-Agent, If-Modified-Since).
// MIME headers are ASCII only, so no Unicode issues.
- if a[i] == ' ' {
- a[i] = '-'
- upper = true
- continue
- }
c := a[i]
- if upper && 'a' <= c && c <= 'z' {
+ if c == ' ' {
+ c = '-'
+ } else if upper && 'a' <= c && c <= 'z' {
c -= toLower
} else if !upper && 'A' <= c && c <= 'Z' {
c += toLower