diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-29 13:12:52 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-29 13:12:52 -0700 |
commit | 95d944613bffce1cee3783568ae229e116168ba4 (patch) | |
tree | 8ccfe59b7852fbc1e937d62898cec52f92ee2c44 /modules/caddyhttp/caddyauth | |
parent | 2b33d9a5e5d1bd12d27bea2cfe8341fd1e5703b2 (diff) |
Export Replacer and use concrete type instead of interface
The interface was only making things difficult; a concrete pointer is
probably best.
Diffstat (limited to 'modules/caddyhttp/caddyauth')
-rw-r--r-- | modules/caddyhttp/caddyauth/caddyauth.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/caddyhttp/caddyauth/caddyauth.go b/modules/caddyhttp/caddyauth/caddyauth.go index aefeec5..dc1dc99 100644 --- a/modules/caddyhttp/caddyauth/caddyauth.go +++ b/modules/caddyhttp/caddyauth/caddyauth.go @@ -76,7 +76,7 @@ func (a Authentication) ServeHTTP(w http.ResponseWriter, r *http.Request, next c return caddyhttp.Error(http.StatusUnauthorized, fmt.Errorf("not authenticated")) } - repl := r.Context().Value(caddy.ReplacerCtxKey).(caddy.Replacer) + repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer) repl.Set("http.authentication.user.id", user.ID) return next.ServeHTTP(w, r) |