Fix Metro crash if no origin header is set
Summary: Changelog: Work-around for missing `origin` header problem https://github.com/facebook/flipper/issues/3189; causing Metro to crash when Flipper tries to connect Will follow up with separate fix in React Native itself as well Reviewed By: nikoant Differential Revision: D33276414 fbshipit-source-id: 34d1510262ac24172ac1c6660799bb755b0f1f11
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bc1a838921
commit
f9c769aee3
@@ -65,7 +65,11 @@ export default (flipperServer: FlipperServerImpl) => {
|
||||
|
||||
if (await isMetroRunning()) {
|
||||
try {
|
||||
const _ws = new WebSocket(METRO_LOGS_ENDPOINT);
|
||||
const _ws = new WebSocket(METRO_LOGS_ENDPOINT, {
|
||||
// temporarily hardcoded URL, as without an origin header, metro will crash, see
|
||||
// https://github.com/facebook/flipper/issues/3189
|
||||
origin: 'http://localhost:3000/flipper',
|
||||
});
|
||||
|
||||
_ws.onopen = () => {
|
||||
clearTimeout(guard);
|
||||
|
||||
Reference in New Issue
Block a user