Skip to content

Commit

Permalink
caddyhttp: run error (msg) through replacer (caddyserver#6536)
Browse files Browse the repository at this point in the history
* error: run `error` (msg) through replacer

Signed-off-by: Mohammed Al Sahaf <[email protected]>

* fix integration test

Signed-off-by: Mohammed Al Sahaf <[email protected]>

---------

Signed-off-by: Mohammed Al Sahaf <[email protected]>
  • Loading branch information
mohammed90 authored Aug 22, 2024
1 parent 098897b commit 8af6467
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion caddytest/caddytest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func TestLoadUnorderedJSON(t *testing.T) {
"servers": {
"s_server": {
"listen": [
":9443",
":9080"
],
"routes": [
Expand Down
3 changes: 1 addition & 2 deletions modules/caddyhttp/staticerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ func (e StaticError) ServeHTTP(w http.ResponseWriter, r *http.Request, _ Handler
}
statusCode = intVal
}

return Error(statusCode, fmt.Errorf("%s", e.Error))
return Error(statusCode, fmt.Errorf("%s", repl.ReplaceKnown(e.Error, "")))
}

// Interface guard
Expand Down

0 comments on commit 8af6467

Please sign in to comment.