Skip to content

Core: Update default allowed hosts in host validation middleware#34045

Merged
ghengeveld merged 1 commit into
nextfrom
default-allowed-hosts
Mar 6, 2026
Merged

Core: Update default allowed hosts in host validation middleware#34045
ghengeveld merged 1 commit into
nextfrom
default-allowed-hosts

Conversation

@ghengeveld
Copy link
Copy Markdown
Member

What I did

Updated the default allowed hosts to restrict all by default.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. Run a local Storybook instance
  2. Run an ngrok tunnel to the Storybook (usually port 6006)
  3. Visit the ngrok URL, verify it prints "Invalid host"
  4. Add the ngrok hostname to core.allowedHosts (main config)
  5. Visit the ngrok URL, verify it works now

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

@ghengeveld ghengeveld added maintenance User-facing maintenance tasks patch:yes Bugfix & documentation PR that need to be picked to main branch ci:normal labels Mar 6, 2026
@ghengeveld ghengeveld self-assigned this Mar 6, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 6, 2026

View your CI Pipeline Execution ↗ for commit 158eaa8

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ❌ Failed 13m 30s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-06 12:28:19 UTC

@ghengeveld ghengeveld merged commit 0bd0483 into next Mar 6, 2026
12 of 23 checks passed
@ghengeveld ghengeveld deleted the default-allowed-hosts branch March 6, 2026 12:54
@github-actions github-actions Bot mentioned this pull request Mar 6, 2026
10 tasks
ghengeveld added a commit that referenced this pull request Mar 6, 2026
Core: Update default allowed hosts in host validation middleware
(cherry picked from commit 0bd0483)
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Mar 6, 2026
@github-actions github-actions Bot mentioned this pull request Mar 9, 2026
31 tasks
jeremyruppel added a commit to coder/coder that referenced this pull request Apr 1, 2026
We recently upgraded storybook and vite in #23485 which bumped our
`storybook` version from 10.2.10 to 10.3.3. In 10.2.16,
storybookjs/storybook#34045 was merged that changes the list of default
allowed hosts to an empty array. This means if you have custom DNS set
up (like through the Coder desktop app) your `.coder` domain will no
longer be able to reach storybook and you'll get an `Invalid host`
response. This is a breaking change, but storybook didn't treat it as
such.

This PR adds the `core.allowedHosts` config to our storybook dev server.
I'm not sure this has the same effect for build so I left the other
`viteFinal` `server.allowedHosts` config, but it may be defunct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants