Closes the findings from an external review. Breaking for some 0.1.0 configs — all three are config-time schema errors with explicit messages, nothing changes silently at runtime:
httpsurl targets now require an explicitpreserve_host. Upstream SNI follows whichever Hostpreserve_hostselects, so the choice must be conscious; with the old default (true) an https target would silently handshake with the client's SNI.- A templated host must pin a literal
:port(e.g.http://$(header.X-Region).internal:8080$(uri)). Otherwise a header value likehost.internal:9090could choose the port on an allowlisted host — internal port-scanning through the gateway. Injected ports are rejected with503(asserted e2e). preserve_hostis rejected onupstreamtargets, where it was silently ignored.
Also: hostnames may contain underscores (internal DNS), and luacheck joins CI.
Verified: 32 unit tests + 20-case e2e suite against Kong 3.9 (new case: injected port on an allowlisted host → 503).
Upgrade from 0.1.0
- Add
preserve_host: true|falseto everyhttpsurl target (you almost always wantfalse). - Add a literal
:portto any url whose host contains a variable. - Remove
preserve_hostfromupstreamtargets.