aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/http.go
diff options
context:
space:
mode:
authorMarvin Stenger <marvin.stenger94@gmail.com>2017-10-05 15:50:11 +0200
committerIan Lance Taylor <iant@golang.org>2017-10-05 23:19:42 +0000
commitd153df8e4b5874692f4948e9c8e10720446058e3 (patch)
tree84567a80b3f90d91bb6d1832073505427c51d67c /src/net/http/http.go
parent90d71fe99e21b68e292327c966946f1706d66514 (diff)
downloadgo-d153df8e4b5874692f4948e9c8e10720446058e3.tar.xz
all: revert "all: prefer strings.LastIndexByte over strings.LastIndex"
This reverts https://golang.org/cl/66372. Updates #22148 Change-Id: I3e94af3dfc11a2883bf28e1d5e1f32f98760b3ee Reviewed-on: https://go-review.googlesource.com/68431 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/http/http.go')
-rw-r--r--src/net/http/http.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/http.go b/src/net/http/http.go
index 7d5b74092e..b95ca89f40 100644
--- a/src/net/http/http.go
+++ b/src/net/http/http.go
@@ -35,7 +35,7 @@ func (k *contextKey) String() string { return "net/http context value " + k.name
// Given a string of the form "host", "host:port", or "[ipv6::address]:port",
// return true if the string includes a port.
-func hasPort(s string) bool { return strings.LastIndexByte(s, ':') > strings.LastIndexByte(s, ']') }
+func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") }
// removeEmptyPort strips the empty port in ":port" to ""
// as mandated by RFC 3986 Section 6.2.3.