Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 09:30 UTC
caddyhttp: run `error` (msg) through replacer (#6536)
* error: run `error` (msg) through replacer Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com> * fix integration test Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com> --------- Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Mohammed Al Sahaf committed
Aug 22, 2024 at 20:32 UTC
8af646730be93f4a00b873d1822bfde6be106696
2 files changed
+1
-3
caddytest/caddytest_test.go
-1
@@ -84,7 +84,6 @@ func TestLoadUnorderedJSON(t *testing.T) {
84
"servers": {
85
"s_server": {
86
"listen": [
87
- ":9443",
87
":9080"
88
],
89
"routes": [
modules/caddyhttp/staticerror.go
+1
-2
@@ -105,8 +105,7 @@ func (e StaticError) ServeHTTP(w http.ResponseWriter, r *http.Request, _ Handler
105
}
106
statusCode = intVal
107
}
108
-
109
- return Error(statusCode, fmt.Errorf("%s", e.Error))
108
+ return Error(statusCode, fmt.Errorf("%s", repl.ReplaceKnown(e.Error, "")))
109
}
110
111
// Interface guard