MCPcopy Index your code
hub / github.com/react/create-react-app / mayProxy

Function mayProxy

packages/react-dev-utils/WebpackDevServerUtils.js:325–335  ·  view source on GitHub ↗
(pathname)

Source from the content-addressed store, hash-verified

323 const sockPath = process.env.WDS_SOCKET_PATH || '/ws';
324 const isDefaultSockHost = !process.env.WDS_SOCKET_HOST;
325 function mayProxy(pathname) {
326 const maybePublicPath = path.resolve(
327 appPublicFolder,
328 pathname.replace(new RegExp('^' + servedPathname), '')
329 );
330 const isPublicFileRequest = fs.existsSync(maybePublicPath);
331 // used by webpackHotDevClient
332 const isWdsEndpointRequest =
333 isDefaultSockHost && pathname.startsWith(sockPath);
334 return !(isPublicFileRequest || isWdsEndpointRequest);
335 }
336
337 if (!/^http(s)?:\/\//.test(proxy)) {
338 console.log(

Callers 1

prepareProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected