diff options
author | Francis Lavoie <lavofr@gmail.com> | 2022-04-25 12:12:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 10:12:10 -0600 |
commit | 3a1e0dbf47429f3ae7ddcbbd9acc3707b0ad0083 (patch) | |
tree | 9851651f43be2d09103a1c76c15430c0ed5e8f6c /modules | |
parent | 77a77c0219d389717ba3b8f8e28bad3462fab655 (diff) |
httpcaddyfile: Deprecate paths in site addresses; use zap logs (#4728)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/fileserver/command.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/reverseproxy/caddyfile.go | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/modules/caddyhttp/fileserver/command.go b/modules/caddyhttp/fileserver/command.go index 654c9b8..7b4ab11 100644 --- a/modules/caddyhttp/fileserver/command.go +++ b/modules/caddyhttp/fileserver/command.go @@ -129,7 +129,7 @@ func cmdFileServer(fs caddycmd.Flags) (int, error) { return caddy.ExitCodeFailedStartup, err } - log.Printf("Caddy 2 serving static files on %s", listen) + log.Printf("Caddy serving static files on %s", listen) select {} } diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index af0c564..b3f9010 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -15,7 +15,6 @@ package reverseproxy import ( - "log" "net" "net/http" "reflect" @@ -552,16 +551,16 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { case 2: // some lint checks, I guess if strings.EqualFold(args[0], "host") && (args[1] == "{hostport}" || args[1] == "{http.request.hostport}") { - log.Printf("[WARNING] Unnecessary header_up ('Host' field): the reverse proxy's default behavior is to pass headers to the upstream") + caddy.Log().Named("caddyfile").Warn("Unnecessary header_up Host: the reverse proxy's default behavior is to pass headers to the upstream") } if strings.EqualFold(args[0], "x-forwarded-for") && (args[1] == "{remote}" || args[1] == "{http.request.remote}" || args[1] == "{remote_host}" || args[1] == "{http.request.remote.host}") { - log.Printf("[WARNING] Unnecessary header_up ('X-Forwarded-For' field): the reverse proxy's default behavior is to pass headers to the upstream") + caddy.Log().Named("caddyfile").Warn("Unnecessary header_up X-Forwarded-For: the reverse proxy's default behavior is to pass headers to the upstream") } if strings.EqualFold(args[0], "x-forwarded-proto") && (args[1] == "{scheme}" || args[1] == "{http.request.scheme}") { - log.Printf("[WARNING] Unnecessary header_up ('X-Forwarded-Proto' field): the reverse proxy's default behavior is to pass headers to the upstream") + caddy.Log().Named("caddyfile").Warn("Unnecessary header_up X-Forwarded-Proto: the reverse proxy's default behavior is to pass headers to the upstream") } if strings.EqualFold(args[0], "x-forwarded-host") && (args[1] == "{host}" || args[1] == "{http.request.host}" || args[1] == "{hostport}" || args[1] == "{http.request.hostport}") { - log.Printf("[WARNING] Unnecessary header_up ('X-Forwarded-Host' field): the reverse proxy's default behavior is to pass headers to the upstream") + caddy.Log().Named("caddyfile").Warn("Unnecessary header_up X-Forwarded-Host: the reverse proxy's default behavior is to pass headers to the upstream") } err = headers.CaddyfileHeaderOp(h.Headers.Request, args[0], args[1], "") case 3: |