Forgot those
All checks were successful
/ docker (push) Successful in 4m8s

This commit is contained in:
Melody Becker 2025-04-20 22:10:55 +02:00
parent 9957ba8302
commit 271acc8d29
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,17 @@
package webmiddleware
import (
"context"
"net/http"
)
const FullPathContextKey KeyType = "request-full-path"
func AppendFullPathMiddleware(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(
w,
r.WithContext(context.WithValue(r.Context(), FullPathContextKey, r.URL.Path)),
)
})
}

View file

@ -0,0 +1,3 @@
package webmiddleware
type KeyType string