Use realIP
All checks were successful
Build and Push Docker Image on Tag / Build and Push Docker Image (push) Successful in 15m31s

Code was copied from https://github.com/go-chi/chi/blob/master/middleware/realip.go
This commit is contained in:
2025-02-01 17:07:24 +01:00
parent 5a0da6560d
commit f519b94392
3 changed files with 24 additions and 2 deletions

View File

@ -20,7 +20,7 @@ func (app *application) recoverPanic(next http.Handler) http.Handler {
func (app *application) logRequest(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var (
ip = r.RemoteAddr
ip = realIP(r)
proto = r.Proto
method = r.Method
uri = r.URL.RequestURI()