0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-20 22:52:58 -05:00
caddy/caddytest/integration/caddyfile_adapt
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
..
auto_https_disable_redirects.txt
auto_https_ignore_loaded_certs.txt
auto_https_off.txt
bind_ipv6.txt httpcaddyfile: Fix incorrect handling of IPv6 bind addresses (#4532) 2022-01-18 11:27:43 -07:00
encode_options.txt
error_example.txt
expression_quotes.txt caddyfile: Support for raw token values; improve map, expression (#4643) 2022-03-18 15:08:23 -06:00
file_server_disable_canonical_uris.txt
file_server_pass_thru.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
file_server_precompressed.txt
file_server_status.txt
global_options.txt httpcaddyfile: Disabling OCSP stapling for both managed and unmanaged (#4589) 2022-02-19 14:20:38 -07:00
global_options_acme.txt
global_options_admin.txt
global_options_default_bind.txt httpcaddyfile: Add default_bind global option (#4531) 2022-01-18 11:29:07 -07:00
global_options_log_and_site.txt
global_options_log_basic.txt
global_options_log_custom.txt
global_options_log_multi.txt
global_options_preferred_chains.txt
global_options_skip_install_trust.txt httpcaddyfile: Add pki app root and intermediate cert/key config (#4514) 2022-01-18 12:18:31 -07:00
global_server_options_multi.txt httpcaddyfile: Support explicitly turning off strict_sni_host (#4592) 2022-03-01 20:02:39 -05:00
global_server_options_single.txt caddyhttp: Move HTTP redirect listener to an optional module (#4585) 2022-02-19 15:36:36 -07:00
handle_path.txt
handle_path_sorting.txt
header.txt
http_only_hostnames.txt
http_only_on_any_address.txt
http_only_on_domain.txt
http_only_on_hostless_block.txt
http_only_on_localhost.txt
http_only_on_non_standard_port.txt
https_on_domain.txt
import_args_file.txt
import_args_snippet.txt
import_args_snippet_env_placeholder.txt
log_except_catchall_blocks.txt
log_filters.txt
log_roll_days.txt logging: Add roll_local_time Caddyfile option (#4583) 2022-02-19 15:12:28 -07:00
log_skip_hosts.txt
map_and_vars_with_raw_types.txt httpcaddyfile: Add 'vars' directive 2022-03-22 10:47:21 -06:00
matcher_syntax.txt
matchers_in_route.txt
method_directive.txt rewrite: Add method Caddyfile directive (#4528) 2022-01-18 12:17:35 -07:00
metrics_disable_om.txt
metrics_syntax.txt
not_block_merging.txt
php_fastcgi_expanded_form.txt
php_fastcgi_handle_response.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
php_fastcgi_index_off.txt
php_fastcgi_matcher.txt
php_fastcgi_subdirectives.txt
php_fastcgi_try_files_override.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
portless_upstream.txt
request_body.txt
request_header.txt
reverse_proxy_dynamic_upstreams.txt reverseproxy: Dynamic upstreams (with SRV and A/AAAA support) (#4470) 2022-03-06 17:43:39 -07:00
reverse_proxy_empty_non_http_transport.txt
reverse_proxy_h2c_shorthand.txt
reverse_proxy_handle_response.txt reverseproxy: copy_response and copy_response_headers for handle_response routes (#4391) 2022-03-09 11:00:51 -07:00
reverse_proxy_health_headers.txt
reverse_proxy_health_path_query.txt
reverse_proxy_options.txt reverseproxy: Dynamic upstreams (with SRV and A/AAAA support) (#4470) 2022-03-06 17:43:39 -07:00
reverse_proxy_trusted_proxies.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
reverse_proxy_upstream_placeholder.txt
shorthand_parameterized_placeholders.txt
site_block_sorting.txt
sort_directives_with_any_matcher_first.txt
sort_directives_within_handle.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
tls_acme_preferred_chains.txt
tls_automation_policies_1.txt
tls_automation_policies_2.txt
tls_automation_policies_3.txt
tls_automation_policies_4.txt
tls_automation_policies_5.txt
tls_automation_policies_6.txt
tls_automation_policies_7.txt
tls_automation_policies_8.txt
tls_automation_policies_9.txt httpcaddyfile: Fix #4640 (auto-HTTPS edgecase) (#4661) 2022-03-24 22:54:03 -06:00
tls_automation_policies_global_email_localhost.txt
tls_client_auth_cert_file.txt
tls_client_auth_inline_cert.txt
tls_conn_policy_consolidate.txt
tls_internal_options.txt chore: Clean up adapt test line endings (#4660) 2022-03-24 22:48:45 -06:00
tls_propagation_timeout.txt
tracing.txt tracing: New OpenTelemetry module (#4361) 2022-03-08 12:18:32 -07:00