Skip to content

Commit

Permalink
Add 127.0.0.1 to allowlist for source map fetch
Browse files Browse the repository at this point in the history
Summary:
Adds ipv4 localhost representation (127.0.0.1) to allowlisted hostnames for the inspector-proxy, to allow for proxied network requests fetching source maps.

Changelog:
[General][Fixed] Allow source map fetching in the inspector proxy from 127.0.0.1

Reviewed By: motiz88

Differential Revision: D52112849

fbshipit-source-id: e6d45fa2fdfd570b7ab4f36121ba615c9b06d442
  • Loading branch information
Ian Park authored and facebook-github-bot committed Dec 13, 2023
1 parent 957a197 commit 46d304a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dev-middleware/src/inspector-proxy/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ export default class Device {
// Fetch text, raising an exception if the text could not be fetched,
// or is too large.
async _fetchText(url: URL): Promise<string> {
if (url.hostname !== 'localhost') {
if (!['localhost', '127.0.0.1'].includes(url.hostname)) {
throw new Error('remote fetches not permitted');
}

Expand Down

0 comments on commit 46d304a

Please sign in to comment.