summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/staticresp.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/staticresp.go')
-rw-r--r--modules/caddyhttp/staticresp.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/staticresp.go b/modules/caddyhttp/staticresp.go
index 506689a..69ec45b 100644
--- a/modules/caddyhttp/staticresp.go
+++ b/modules/caddyhttp/staticresp.go
@@ -23,16 +23,16 @@ type Static struct {
}
func (s Static) ServeHTTP(w http.ResponseWriter, r *http.Request) error {
- repl := r.Context().Value(ReplacerCtxKey).(*Replacer)
+ repl := r.Context().Value(caddy2.ReplacerCtxKey).(caddy2.Replacer)
// close the connection after responding
r.Close = s.Close
// set all headers, with replacements
for field, vals := range s.Headers {
- field = repl.Replace(field, "")
+ field = repl.ReplaceAll(field, "")
for i := range vals {
- vals[i] = repl.Replace(vals[i], "")
+ vals[i] = repl.ReplaceAll(vals[i], "")
}
w.Header()[field] = vals
}
@@ -46,7 +46,7 @@ func (s Static) ServeHTTP(w http.ResponseWriter, r *http.Request) error {
// write the response body, with replacements
if s.Body != "" {
- fmt.Fprint(w, repl.Replace(s.Body, ""))
+ fmt.Fprint(w, repl.ReplaceAll(s.Body, ""))
}
return nil