fix(@angular/ssr): improve header validation logic#32622
fix(@angular/ssr): improve header validation logic#32622alan-agius4 merged 1 commit intoangular:21.2.xfrom
Conversation
Updates the `validateRequest` function to correctly handle the `allowedHost=true` option.
53f59db to
d78ace4
Compare
dgp1130
left a comment
There was a problem hiding this comment.
Question: Is allowedHosts: true distinct from allowedHosts: ['*'], which could also be set via environment variable? Is there a reason to prefer this instead?
|
|
||
| // Disable host check if allowed hosts is true meaning allow all hosts. | ||
| const { allowedHosts } = server.config.server; | ||
| const disableAllowedHostsCheck = allowedHosts === true; |
There was a problem hiding this comment.
Consider framing this in the positive like:
const checkAllowedHosts = Array.isArray(allowedHosts);As positive conditionals can often be easier to reason about.
|
‘allowedHosts: ['*']’ is not supported, and ‘allowedHost=true` is already an option supported by Vite. |
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Updates the
validateRequestfunction to correctly handle theallowedHost=trueoption.