@@ -269,8 +269,6 @@ function onProxyError(proxy) {
269
269
270
270
function prepareProxy ( proxy , appPublicFolder ) {
271
271
// `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
274
272
if ( ! proxy ) {
275
273
return undefined ;
276
274
}
@@ -287,7 +285,7 @@ function prepareProxy(proxy, appPublicFolder) {
287
285
process . exit ( 1 ) ;
288
286
}
289
287
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.
291
289
function mayProxy ( pathname ) {
292
290
const maybePublicPath = path . resolve ( appPublicFolder , pathname . slice ( 1 ) ) ;
293
291
return ! fs . existsSync ( maybePublicPath ) ;
@@ -321,7 +319,7 @@ function prepareProxy(proxy, appPublicFolder) {
321
319
// For `GET` requests, if request `accept`s text/html, we pick /index.html.
322
320
// Modern browsers include text/html into `accept` header when navigating.
323
321
// 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` .
325
323
context : function ( pathname , req ) {
326
324
return (
327
325
req . method !== 'GET' ||
@@ -331,7 +329,7 @@ function prepareProxy(proxy, appPublicFolder) {
331
329
) ;
332
330
} ,
333
331
onProxyReq : proxyReq => {
334
- // Browers may send Origin headers even with same-origin
332
+ // Browsers may send Origin headers even with same-origin
335
333
// requests. To prevent CORS issues, we have to change
336
334
// the Origin to match the target URL.
337
335
if ( proxyReq . getHeader ( 'origin' ) ) {
0 commit comments