1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00
caddy/caddyconfig
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
..
caddyfile caddyfile: Prevent bad block opening tokens (#4655) 2022-03-23 12:34:13 -06:00
httpcaddyfile httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661) 2022-03-24 22:54:03 -06:00
configadapters.go admin: Identity management, remote admin, config loaders (#3994) 2021-01-27 16:16:04 -07:00
httploader.go caddyconfig: Support placeholders in HTTP loader 2022-02-17 22:58:25 -07:00
load.go admin: Identity management, remote admin, config loaders (#3994) 2021-01-27 16:16:04 -07:00