Skip to content
This repository was archived by the owner on Jun 3, 2019. It is now read-only.

Commit 550e809

Browse files
diondirzactrlplusb
authored andcommitted
Fix CORS host (#432)
1 parent 19b749c commit 550e809

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/development/hotClientServer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import express from 'express';
22
import createWebpackMiddleware from 'webpack-dev-middleware';
33
import createWebpackHotMiddleware from 'webpack-hot-middleware';
44
import ListenerManager from './listenerManager';
5+
import config from '../../config';
56
import { log } from '../utils';
67

78
class HotClientServer {
@@ -23,7 +24,7 @@ class HotClientServer {
2324
quiet: true,
2425
noInfo: true,
2526
headers: {
26-
'Access-Control-Allow-Origin': '*',
27+
'Access-Control-Allow-Origin': `http://${config('host')}:${config('port')}`,
2728
},
2829
// Ensure that the public path is taken from the compiler webpack config
2930
// as it will have been created as an absolute path to avoid conflicts

0 commit comments

Comments
 (0)