Don't include port in REMOTE_ADDR #18

Merged
solderpunk merged 2 commits from makeworld/molly-brown:master into master 2020-12-27 17:40:20 +00:00
Contributor

Section 4.1.8 of the CGI RFC (3875) states that REMOTE_ADDR should be an IP address.

But conn.RemoteAddr().String() contains the remote port as well. This broke my CGI application.

I've added code so just the IP address will be in REMOTE_ADDR. Note the error is ignored, since conn.RemoteAddr().String() will always have a port.

[Section 4.1.8](https://tools.ietf.org/html/rfc3875#section-4.1.8) of the CGI RFC (3875) states that `REMOTE_ADDR` should be an IP address. But `conn.RemoteAddr().String()` contains the remote port as well. This broke my CGI application. I've added code so just the IP address will be in `REMOTE_ADDR`. Note the error is ignored, since `conn.RemoteAddr().String()` will always have a port.
Owner

Thanks a lot for this fix, makeworld. Have you accidentally committed a compiled executable as well?

Thanks a lot for this fix, makeworld. Have you accidentally committed a compiled executable as well?
makeworld force-pushed master from d5eb0f9940 to 99ba34c2b7 2020-12-27 16:13:33 +00:00 Compare
Author
Contributor

Yikes, thanks for catching that. I'm used to the .gitignore keeping it out. I've rewritten the history so the binary was never there, so you should be able to merge without adding it to repo (and increasing its size by several MiBs).

Yikes, thanks for catching that. I'm used to the `.gitignore` keeping it out. I've rewritten the history so the binary was never there, so you should be able to merge without adding it to repo (and increasing its size by several MiBs).
solderpunk merged commit 2e4a10297e into master 2020-12-27 17:40:20 +00:00
Owner

Splendid, thanks!

Splendid, thanks!
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: solderpunk/molly-brown#18
No description provided.