Skip to content

listener: a frontend copied to a new listener on the same address does not inherit that listener's HSTS default #1691

Closed

Description

@FlorentinDUBOIS

Follow-up to #1686 (listeners bound to a network interface), found in its review.

When a listener is added on an address that already has a listener, #1686 copies the sibling's routes into it. A frontend that carries policy (tags, headers, redirects) and had no hsts of its own, added while the sibling listener had no HSTS default, is stored with inherits_listener_hsts = false. On the new listener, which may have a different HSTS default, that copied frontend therefore does not get the new listener's HSTS header, whereas the same frontend added after the listener existed would inherit it. Frontends without policy are promoted correctly.

It only matters when listeners sharing an address have different HSTS defaults.

Fix: record "no HSTS at add time" on the frontend instead of the resolved origin, so each listener resolves inheritance against its own default. Test: two listeners on one address with different HSTS defaults, a tagged frontend without hsts, both listeners serve their own default.

Also noted in the same review, not addressed by #1686: cluster answer templates reach only listeners existing when the cluster is added, so a listener added later serves the default 503 page for that cluster (pre-existing behaviour).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions