mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
FastCGI: IPv6 when parsing r.RemoteAddr
This commit is contained in:
parent
a8c8b48390
commit
d8be787f39
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
|
|||
|
||||
// Separate remote IP and port; more lenient than net.SplitHostPort
|
||||
var ip, port string
|
||||
if idx := strings.Index(r.RemoteAddr, ":"); idx > -1 {
|
||||
if idx := strings.LastIndex(r.RemoteAddr, ":"); idx > -1 {
|
||||
ip = r.RemoteAddr[:idx]
|
||||
port = r.RemoteAddr[idx+1:]
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue