]> Cypherpunks.ru repositories - gostls13.git/commit
net/http/cgi: fix REMOTE_ADDR, REMOTE_HOST, add REMOTE_PORT
authorAlex Sergeyev <abc@alexsergeyev.com>
Mon, 16 Feb 2015 14:29:37 +0000 (09:29 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 18 Feb 2015 19:56:50 +0000 (19:56 +0000)
commiteaf8e8cbe576a8553214ffc8e2ce09e9fbc6e87e
tree8d8061bc4807533fff421e18471b9fafb26eeb00
parentb2c2bc48564a322a0d68ae429ec6a19836dfd6c1
net/http/cgi: fix REMOTE_ADDR, REMOTE_HOST, add REMOTE_PORT

Env vars were incorrectly copying whole value of http.RemoteAddr
to REMOTE_ADDR and REMOTE_HOST. They contained IP:port pair which
instead should only have IP (RFC 3875, other sources).

Module also was not setting REMOTE_PORT variable which become de-facto
standard for passing TCP client port to CGI scripts (Apache mod_cgi,
IIS, and probably others)

Fixes #9861

Change-Id: Ia73e664c48539e3c7db4997d09d957884e98d8a5
Reviewed-on: https://go-review.googlesource.com/4933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/cgi/host.go
src/net/http/cgi/host_test.go
src/net/http/cgi/matryoshka_test.go