react-native/local-cli/server/middleware
Nico 29f8354c19 Prevents JS Debugger issues with CORS
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

See #17618

On certain networks, `xip.io` is used, but as the debugger will always using localhost a change upstream has resulted in a CORS issue (see screenshots in #17618). This change ensures that the debugger will always open with whatever configuration.

> This should be merged in as a patch of `0.52.x` as it affects current release, and `0.51.x` didn't have this issue.

Tested locally, could do with the people having the same issue in #17618 testing it out prior to merging.

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[CLI] [BUGFIX] [local-cli/server/middleware/getDevToolsMiddleware.js] - Prevents JS Debugger issues with CORS
Closes https://github.com/facebook/react-native/pull/17720

Differential Revision: D6828205

Pulled By: hramos

fbshipit-source-id: 7e5d43db9faf7edc9444ba4214aca1a18e25dbd2
2018-01-27 02:36:12 -08:00
..
copyToClipBoardMiddleware.js Add Copy and Dismiss Button in RN Android Red Box 2016-06-30 08:13:22 -07:00
getDevToolsMiddleware.js Prevents JS Debugger issues with CORS 2018-01-27 02:36:12 -08:00
index.html Add index page for packager 2016-05-24 11:58:23 -07:00
indexPage.js Add index page for packager 2016-05-24 11:58:23 -07:00
loadRawBodyMiddleware.js Move files from `packager/` to `local-cli` 2015-10-26 15:38:14 -07:00
openStackFrameInEditorMiddleware.js Packager: Options Cleanup 2016-11-28 12:43:34 -08:00
statusPageMiddleware.js Move files from `packager/` to `local-cli` 2015-10-26 15:38:14 -07:00
systraceProfileMiddleware.js Update message with instructions 2017-03-20 10:49:43 -07:00
unless.js Add packager inspector proxy 2016-11-15 08:59:02 -08:00