summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-14 09:40:31 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-14 09:40:31 -0600
commita768f589b9ce146ae227115713966d439750e9d5 (patch)
tree1feac6357499d0a23036bf250fb0a2fbb57dd878
parent6d73747c25ce518db5742d0c2d465f3e5f9881a1 (diff)
add REMOTE_PORT to CGI env
-rw-r--r--contrib/cgi/cgi.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go
index de0d35f..48af04a 100644
--- a/contrib/cgi/cgi.go
+++ b/contrib/cgi/cgi.go
@@ -147,8 +147,8 @@ func prepareCGIEnv(
"QUERY_STRING=" + request.RawQuery,
}
- host, _, _ := net.SplitHostPort(request.RemoteAddr.String())
- environ = append(environ, "REMOTE_ADDR="+host)
+ host, port, _ := net.SplitHostPort(request.RemoteAddr.String())
+ environ = append(environ, "REMOTE_ADDR="+host, "REMOTE_PORT="+port)
environ = append(
environ,