File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,20 @@ const EXTRA_HEADERS = {
2424} ;
2525
2626// Allowed hosts for dev server
27- const BASE_ALLOWED_HOSTS = [ 'localhost' , '.app.github.dev' ] ;
27+ const ALLOWED_HOSTS = [ 'localhost' , '.app.github.dev' ] ;
2828
2929function isHostAllowed ( hostHeader , boundHost ) {
3030 if ( ! hostHeader ) {
3131 return false ;
3232 }
3333
3434 // When binding to all interfaces, allow any host.
35- if ( boundHost === '0.0.0.0' ) {
35+ if ( boundHost === '0.0.0.0' || boundHost === '::' || boundHost === '::0' ) {
3636 return true ;
3737 }
3838
3939 const hostname = hostHeader . split ( ':' ) [ 0 ] ;
40- const allowedHosts = [ ...BASE_ALLOWED_HOSTS , boundHost ] ;
40+ const allowedHosts = [ ...ALLOWED_HOSTS , boundHost ] ;
4141
4242 return allowedHosts . some ( ( allowedHost ) => {
4343 if ( allowedHost . startsWith ( '.' ) ) {
@@ -90,7 +90,10 @@ export async function startDevServer(buildConfig, options = {}) {
9090 port : esbuildServerPort ,
9191 path : req . url ,
9292 method : req . method ,
93- headers : req . headers ,
93+ headers : {
94+ ...req . headers ,
95+ host : hostname + ':' + esbuildServerPort ,
96+ } ,
9497 } ;
9598
9699 // Forward each incoming request to esbuild
You can’t perform that action at this time.
0 commit comments