Skip to content

Expose inbound request host to http-server templates - #207

Merged
andrewkroh merged 1 commit into
elastic:mainfrom
andrewkroh:expose-request-host-to-http-server-templates
Jul 8, 2026
Merged

Expose inbound request host to http-server templates#207
andrewkroh merged 1 commit into
elastic:mainfrom
andrewkroh:expose-request-host-to-http-server-templates

Conversation

@andrewkroh

Copy link
Copy Markdown
Member

Mock APIs need same-origin absolute URLs in Link headers and pagination responses, but {{ hostname }} returns the container OS hostname rather than the host the client used. Add .request.host from http.Request.Host so fixtures can build URLs from the actual inbound request.

Closes #206

@andrewkroh andrewkroh added the enhancement New feature or request label Jul 8, 2026
@andrewkroh
andrewkroh force-pushed the expose-request-host-to-http-server-templates branch from cd033c6 to bb41bb0 Compare July 8, 2026 13:35
@andrewkroh andrewkroh added the Team:Security-Service Integrations Team:Security-Service Integrations label Jul 8, 2026
@andrewkroh
andrewkroh requested a review from a team July 8, 2026 13:35
Mock APIs need same-origin absolute URLs in Link headers and pagination
responses, but {{ hostname }} returns the container OS hostname rather than
the host the client used. Add .request.host from http.Request.Host so
fixtures can build URLs from the actual inbound request.

Closes elastic#206
@andrewkroh
andrewkroh force-pushed the expose-request-host-to-http-server-templates branch from bb41bb0 to ec84eea Compare July 8, 2026 14:10
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@andrewkroh
andrewkroh merged commit 8071ce9 into elastic:main Jul 8, 2026
8 checks passed
andrewkroh added a commit to elastic/integrations that referenced this pull request Aug 4, 2026
#20520)

Replace stream {{ hostname }}:PORT absolute URLs in system-test mocks with {{ .request.host }}, bump mock images to stream:v0.23.0, remove compose `hostname: svc-*` pins, and drop unused compose PORT env (listen via --addr).

httpjson rejects pagination when the mock emits a container-ID origin instead of the svc-* alias the agent uses. elastic/stream#206 and elastic/stream#207 expose the inbound request Host so mocks stay same-origin.

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

Labels

enhancement New feature or request Team:Security-Service Integrations Team:Security-Service Integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose request host to http-server response templates

2 participants