caddy/caddyconfig/httpcaddyfile
Francis Lavoie a58f240d3e
httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661)
Guh, this is complicated.

Fixes #4640

This also follows up on #4398 (reverting it) which made a change that technically worked, but was incorrect. It changed the condition in `hostsFromKeysNotHTTP` from `&&` to `||`, but then the function no longer did what its name said it would do, and it would return hosts even if they were marked with `http://`, if they used a non-HTTP port. That wasn't the intent of it. The test added in there was kept though, because it is a valid usecase.

The actual fix is to check _earlier_ whether all the addresses explicitly have `http://`, and if so we can short circuit and skip considering the rest.
2022-03-24 22:54:03 -06:00
..
addresses.go httpcaddyfile: Add default_bind global option (#4531) 2022-01-18 11:29:07 -07:00
addresses_fuzz.go ci: Build on Go 1.18, bump actions versions (#4637) 2022-03-15 22:09:19 +00:00
addresses_test.go httpcaddyfile: Preserve IPv6 addresses through normalization (fix #4381) 2021-10-20 10:27:59 -06:00
builtins.go httpcaddyfile: Add 'vars' directive 2022-03-22 10:47:21 -06:00
builtins_test.go caddyhttp: Split up logged remote address into IP and port (#4403) 2021-11-29 01:18:35 -05:00
directives.go httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661) 2022-03-24 22:54:03 -06:00
directives_test.go tests: Clean up redundant type declarations 2020-04-10 08:48:21 -06:00
httptype.go httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661) 2022-03-24 22:54:03 -06:00
httptype_test.go caddyfile: Introduce basic linting and fmt check (#3923) 2021-01-04 11:11:36 -07:00
options.go caddytls: Support external certificate Managers (like Tailscale) (#4541) 2022-02-17 15:40:34 -07:00
options_test.go caddyconfig: add global option for configuring loggers (#4028) 2021-03-12 13:00:02 -07:00
pkiapp.go httpcaddyfile: Add pki app root and intermediate cert/key config (#4514) 2022-01-18 12:18:31 -07:00
serveroptions.go httpcaddyfile: Support explicitly turning off strict_sni_host (#4592) 2022-03-01 20:02:39 -05:00
tlsapp.go httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661) 2022-03-24 22:54:03 -06:00
tlsapp_test.go httpcaddyfile: Revise automation policy generation (#3824) 2020-10-28 20:36:00 -06:00