Comments (6)
Your API server needs to manage CORS by exposing Access-Control-Allow-Origin
HTTP Header on each response.
Here is an explainer/tutorial.
from react-admin.
Great. Thanks. The problem is not the admin component?
Do you believe that the problem is my server api?
El 4 nov. 2016 7:25 a. m., "Kmaschta" [email protected] escribió:
Your API servers need to manage CORS by exposing
Access-Control-Allow-Origin HTTP Header on each response.Here is an explainer/tutorial
https://www.eriwen.com/javascript/how-to-cors/.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/marmelab/admin-on-rest/issues/126#issuecomment-258429849,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD7W_5_CssfAD-RMQU2Bw39rpvfcdiqhks5q6zItgaJpZM4Kpe6l
.
from react-admin.
Sure, it is.
All the modern browsers doesn't allow to do HTTP requests other than GET if the client host is different from the requested server.
It is the server's role to define which host is allowed to request it.
from react-admin.
Thanks for the support. Right now I am reviewing my API server.
For the moment, I attached the error console browser.
2016-11-04 7:35 GMT-06:00 Kmaschta [email protected]:
Sure, it is.
All the moderns browsers doesn't allow to do HTTP requests other than GET
if the client host is different from the requested server.It is the serve's role to define which host is allowed to request it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/marmelab/admin-on-rest/issues/126#issuecomment-258432191,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD7W_6OBzDtYw5oKl3vb8gs7h6rO2uR4ks5q6zSLgaJpZM4Kpe6l
.
"El secreto del éxito no lo conozco, pero el del fracaso es tratar de
agradarle a los demas"
from react-admin.
The problem persist. I added the server API
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site
HTTP requests
app.all('', (req, res, next) => {
res.header("Access-Control-Allow-Origin", "");
res.header("Access-Control-Allow-Methods",
"GET,HEAD,OPTIONS,POST,PUT");
res.header("Access-Control-Allow-Headers", "Origin,
X-Requested-With, Content-Type, Accept, Authorization");
next();
});
In the admin I have:
<Admin restClient={simpleRestClient('http://localhost:5000')}
title="Example Admin">
,
document.getElementById('root')
);
Error console
fetch-mock.js:284 unmatched call to http://localhost:5000/todos
Fetch API cannot load http://localhost:5000/todos. Response to preflight
request doesn't pass access control check: A wildcard '*' cannot be used in
the 'Access-Control-Allow-Origin' header when the credentials flag is true.
Origin 'http://localhost:8080' is therefore not allowed access.
failure.js:18 TypeError: Failed to fetch
2016-11-04 8:19 GMT-06:00 Gerardo Lopez [email protected]:
Thanks for the support. Right now I am reviewing my API server.
For the moment, I attached the error console browser.2016-11-04 7:35 GMT-06:00 Kmaschta [email protected]:
Sure, it is.
All the moderns browsers doesn't allow to do HTTP requests other than GET
if the client host is different from the requested server.It is the serve's role to define which host is allowed to request it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/marmelab/admin-on-rest/issues/126#issuecomment-258432191,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD7W_6OBzDtYw5oKl3vb8gs7h6rO2uR4ks5q6zSLgaJpZM4Kpe6l
."El secreto del éxito no lo conozco, pero el del fracaso es tratar de
agradarle a los demas"
"El secreto del éxito no lo conozco, pero el del fracaso es tratar de
agradarle a los demas"
from react-admin.
The error message seems pretty self explanatory. Try to restrict the Access-Control-Allow-Origin
header to the actual locations you're issuing the request from.
Note that if both the admin and the API are hosted on localhost
, you shouldn't have any CORS problem.
from react-admin.
Related Issues (20)
- `TextInput` component not handling events during the initial life cycles HOT 4
- combineDataProviders does not support more than 2 parameters in custom dataProvider methods HOT 1
- `CoreAdminUI` wraps everything in a `<div>` HOT 2
- useWatch on fields with required in edit is not working HOT 1
- The 'QueryClient' type does not have queryCache, mutationCache, defaultOptions, queryDefaults and four other properties of the 'QueryClient' type. HOT 3
- CheckboxGroupInput : disabling some of the checkboxes Feature HOT 3
- Bug / Breaking change without major for useTheme behaviour HOT 5
- Multiple expandable datagrids: expanding a row triggers all datagrids to expand HOT 8
- AutocompleteInput in ReferenceArrayInput with dynamic choices shows empty field on selection HOT 5
- Property "resource" in SortButtonProps not involved HOT 2
- Change title property type in core display components <Edit>, <Show>, <View> HOT 1
- Standalone version of the Store for a dual-store strategy HOT 3
- Unable to clear default value in DateTimeInput component HOT 3
- Documented theme level defaultProps overrides do not work for react admin components HOT 4
- Reference Array selected item from a filter query vanishes immediately after selection. HOT 2
- Infinite re-rendering using disabled AutocompleteArrayInput in a ReferenceArrayInput HOT 6
- AutocompleteInput don't keep focus with mouse HOT 5
- Documentation update in sample. HOT 3
- NumberInput's `onBlur` prop does not provide an event object HOT 2
- Add ability to customize query string format for lists HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-admin.