From 8c8bbca7cad64acc0a179071030a579cc12221c1 Mon Sep 17 00:00:00 2001 From: David Beitey <david@davidjb.com> Date: Fri, 29 Sep 2017 13:02:22 +1000 Subject: [PATCH] Minor change to highlight dev proxy behaviour (#3075) --- packages/react-scripts/template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 64b63ee8d..9daa9992f 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -983,7 +983,7 @@ To tell the development server to proxy any unknown requests to your API server "proxy": "http://localhost:4000", ``` -This way, when you `fetch('/api/todos')` in development, the development server will recognize that it’s not a static asset, and will proxy your request to `http://localhost:4000/api/todos` as a fallback. The development server will only attempt to send requests without a `text/html` accept header to the proxy. +This way, when you `fetch('/api/todos')` in development, the development server will recognize that it’s not a static asset, and will proxy your request to `http://localhost:4000/api/todos` as a fallback. The development server will **only** attempt to send requests without `text/html` in its `Accept` header to the proxy. Conveniently, this avoids [CORS issues](http://stackoverflow.com/questions/21854516/understanding-ajax-cors-and-security-considerations) and error messages like this in development: -- GitLab