echo icon indicating copy to clipboard operation
echo copied to clipboard

Add middleware with support proxy headers

Open padremortius opened this issue 2 years ago • 5 comments

Add middleware for support proxy headers (based on code gorilla mux handler https://github.com/gorilla/handlers/blob/master/proxy_headers.go)

padremortius avatar May 15 '23 21:05 padremortius

NB: it is missing tests

aldas avatar May 15 '23 21:05 aldas

@padremortius Do you want to continue on this PR or shall we close it?

lammel avatar Jul 11 '23 21:07 lammel

@lammel, yes. Added some changes and unit-test

padremortius avatar Jul 13 '23 15:07 padremortius

unit tests are only for scheme parsing. this is only small part of that middleware.


Currently it introduces new header "forwarded" RFC7239 which I think - if implemented should be integrated into c.RealIP() and IPExtractor code as well.

about RFC7239 and Go standard library https://github.com/golang/go/issues/30963

maybe instead of that Regex we could have small parser that takes in header value, goes over that rune/char by rune/char and outputs parsed parts or an error. RFC7239 should not be that complex as spec is not that complex.

aldas avatar Jul 13 '23 21:07 aldas