set_context.go 301 B

1234567891011121314
  1. package handlers
  2. import (
  3. "net/http"
  4. "codeberg.org/vnpower/pixivfe/v2/request_context"
  5. )
  6. func ProvideUserContext(h http.Handler) http.Handler {
  7. return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  8. h.ServeHTTP(w, r.WithContext(request_context.ProvideWith(r.Context())))
  9. })
  10. }