Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 12:15 UTC
chore: replace `interface{}` with `any` for modernization (#7571)
Signed-off-by: tsinglua <tsinglua@outlook.com>
tsinglua committed
Apr 12, 2026 at 00:53 UTC
0722cf6fd8e999d137aa1fb520d4c3bbdcc8b63e
1 file changed
+4
-4
modules/caddyhttp/reverseproxy/headers_test.go
+4
-4
@@ -17,7 +17,7 @@ func TestAddForwardedHeadersNonIP(t *testing.T) {
17
18
// Mock the context variables required by Caddy.
19
// We need to inject the variable map manually since we aren't running the full server.
20
- vars := map[string]interface{}{
20
+ vars := map[string]any{
21
caddyhttp.TrustedProxyVarKey: false,
22
}
23
ctx := context.WithValue(req.Context(), caddyhttp.VarsCtxKey, vars)
@@ -42,7 +42,7 @@ func TestAddForwardedHeaders_UnixSocketTrusted(t *testing.T) {
42
req.Header.Set("X-Forwarded-Proto", "https")
43
req.Header.Set("X-Forwarded-Host", "original.example.com")
44
45
- vars := map[string]interface{}{
45
+ vars := map[string]any{
46
caddyhttp.TrustedProxyVarKey: true,
47
caddyhttp.ClientIPVarKey: "1.2.3.4",
48
}
@@ -74,7 +74,7 @@ func TestAddForwardedHeaders_UnixSocketUntrusted(t *testing.T) {
74
req.Header.Set("X-Forwarded-Proto", "https")
75
req.Header.Set("X-Forwarded-Host", "spoofed.example.com")
76
77
- vars := map[string]interface{}{
77
+ vars := map[string]any{
78
caddyhttp.TrustedProxyVarKey: false,
79
caddyhttp.ClientIPVarKey: "",
80
}
@@ -103,7 +103,7 @@ func TestAddForwardedHeaders_UnixSocketTrustedNoExistingHeaders(t *testing.T) {
103
req := httptest.NewRequest("GET", "http://example.com/", nil)
104
req.RemoteAddr = "@"
105
106
- vars := map[string]interface{}{
106
+ vars := map[string]any{
107
caddyhttp.TrustedProxyVarKey: true,
108
caddyhttp.ClientIPVarKey: "5.6.7.8",
109
}