Skip to content

Commit 4878f2c

Browse files
mjacksonianschmitz
authored andcommitted
Correct some comments (#5927)
And remove some outdated info from 1.x
1 parent 5352a0c commit 4878f2c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/react-dev-utils/WebpackDevServerUtils.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ function onProxyError(proxy) {
269269

270270
function prepareProxy(proxy, appPublicFolder) {
271271
// `proxy` lets you specify alternate servers for specific requests.
272-
// It can either be a string or an object conforming to the Webpack dev server proxy configuration
273-
// https://webpack.github.io/docs/webpack-dev-server.html
274272
if (!proxy) {
275273
return undefined;
276274
}
@@ -287,7 +285,7 @@ function prepareProxy(proxy, appPublicFolder) {
287285
process.exit(1);
288286
}
289287

290-
// Otherwise, if proxy is specified, we will let it handle any request except for files in the public folder.
288+
// If proxy is specified, let it handle any request except for files in the public folder.
291289
function mayProxy(pathname) {
292290
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1));
293291
return !fs.existsSync(maybePublicPath);
@@ -321,7 +319,7 @@ function prepareProxy(proxy, appPublicFolder) {
321319
// For `GET` requests, if request `accept`s text/html, we pick /index.html.
322320
// Modern browsers include text/html into `accept` header when navigating.
323321
// However API calls like `fetch()` won’t generally accept text/html.
324-
// If this heuristic doesn’t work well for you, use a custom `proxy` object.
322+
// If this heuristic doesn’t work well for you, use `src/setupProxy.js`.
325323
context: function(pathname, req) {
326324
return (
327325
req.method !== 'GET' ||
@@ -331,7 +329,7 @@ function prepareProxy(proxy, appPublicFolder) {
331329
);
332330
},
333331
onProxyReq: proxyReq => {
334-
// Browers may send Origin headers even with same-origin
332+
// Browsers may send Origin headers even with same-origin
335333
// requests. To prevent CORS issues, we have to change
336334
// the Origin to match the target URL.
337335
if (proxyReq.getHeader('origin')) {

0 commit comments

Comments
 (0)