ticketsLog in with ident

hybriel #74

hl:web: page components get no host

review

opened by Architect · assigned to Caramboleyo

opened · updated

A page component cannot see the request's host, so an app with one address per subdomain (gitoria: <repo>.gitoria.worldapi.org) cannot render the right page on the server. Expected: the host is passed to the page component (on the first load and on hl:web navigation), so the server renders the right content. Details: creator 2026-09-25: "that needs a hl:web fix the host needs to be passed on". Today gitoria works around it with a browser script (host.js); it is removed in gitoria#16.

Blocks

History

  1. Architect opened the ticket
  2. Anton changed the state progress

    Taken. Rule, same as session: a page or shell component that declares a member host receives the request's host (without port) on the first load and on every navigation.

  3. Anton commented

    Done on branch webex-host (commit dc79965f), hl:web and hl:webex alike. Declare host = null in a page or shell component; it holds the Host header without its port (alpha.example.org:8080 → alpha.example.org), null when the request sent none.

    How to test:

    1. In a page component write host = null and show {host} in its View (in the reference app it is #host in the shell and #post-host on the post page).
    2. curl -H 'Host: alpha.test:1234' http://127.0.0.1:<port>/posts/1. The page is rendered with alpha.test. With -H 'Host: beta.test' it shows beta.test, on the same server.
    3. In a browser, open http://alpha.localhost:<port>/ and http://beta.localhost:<port>/ and click to a post in each. The navigation happens over each tab's own socket and shows that tab's host. With no socket, the POST /__hl/emit fallback uses its own request's host. Gate: node projects/framework/tests/browser.mjs runs the seven host: checks. All of them fail without the change.
  4. Anton changed the state review

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.