镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(@angular-devkit/build-angular): preserve Host header when proxying in ssr-dev-server - #34261

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:fix-ssr-dev-server-host
Oct 6, 2026
Merged

alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:fix-ssr-dev-server-host

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Configure browser-sync with changeOrigin: false in ssr-dev-server so that the incoming Host header is preserved when proxying requests to the Node SSR server rather than being rewritten to localhost.

…g in ssr-dev-server

Configure `browser-sync` with `changeOrigin: false` in `ssr-dev-server` so that the incoming `Host` header is preserved when proxying requests to the Node SSR server rather than being rewritten to `localhost`.
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Oct 6, 2026
@alan-agius4
alan-agius4 requested a review from dgp1130 October 6, 2026 08:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures changeOrigin: false in the BrowserSync proxy options for the SSR dev server and adds a new test to verify that requests with a disallowed Host header are rejected with a 500 status code. Feedback on the test suggests wrapping the server execution in a try...finally block to guarantee that run.stop() is called even if assertions fail, preventing potential resource or port leaks.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 6, 2026
@alan-agius4
alan-agius4 merged commit 3379a13 into angular:main Oct 6, 2026
40 checks passed
@alan-agius4
alan-agius4 deleted the fix-ssr-dev-server-host branch October 6, 2026 16:39
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

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

Labels

action: merge The PR is ready for merge by the caretaker area: @angular-devkit/build-angular target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants