Skip to content

Conversation

@myovchev
Copy link
Contributor

@myovchev myovchev commented Nov 6, 2025

Summary

Add host validation error handling and tests for Vite middleware

What are the specific steps to test this change?

Requests with not allowed hosts prints console warning.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@myovchev myovchev requested a review from haroun November 6, 2025 13:31
@myovchev myovchev requested a review from haroun November 13, 2025 14:25
@myovchev myovchev requested a review from haroun November 14, 2025 15:08
@haroun
Copy link
Contributor

haroun commented Nov 20, 2025

⚠️  Vite dev server blocked a request from hostname: en-gb-site.test:3000
   This hostname is not in the allowed hosts list.
   To fix this, add the hostname to your Vite configuration:

   // apos.vite.config.js
   import { defineConfig } from '@apostrophecms/vite/vite';

   export default defineConfig({
     server: {
       allowedHosts: ['en-gb-site.test', 'localhost']
     }
   });

cc: @BoDonkey for documentation

@myovchev myovchev merged commit f03e676 into main Nov 20, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants