~bigbes/core-go: 0b2fef24

Normalize remote address before saving to context

One cause for https://todo.sr.ht/~sircmpwn/meta.sr.ht/193 was that code
performing this sanitization was in multiple places, and a fix was not
applied in all places. There is no reasonable expectation for the port
to be present anyways, e.g. if the address is taken from a trusted
reverse proxy's header. Hence, perform the normalization here, so that
the code doing this in applications can be simplified.

Note that this does not yet fix the below ticket, it will just make the
fix easier.

References: https://todo.sr.ht/~sircmpwn/meta.sr.ht/193

Conrad Hoffmann <ch@bitfehler.net> — 2022-05-06 14:46:30 UTC

Commit 0b2fef24c09408b3d4dbf945872177125e120420view raw patch

Parent(s): 8c2729f4

1 changed file(s)

FileStatus+
server/server.go M +11 -1