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)
- Custom Save Button In TopToolbar inside Edit component HOT 2
- V5 beta: List pages are not showing data and display an error notification HOT 2
- Add custom label prop to SelectColumnsButton HOT 2
- Make the icon on the login screen a property so it can be customized HOT 1
- TitleConfigurable logs a warning when customizing the title
- Le chargement du module a été bloqué en raison d'un type MIME interdit ("text/html") HOT 2
- Disabled TextInput in SimpleForm returns undefined HOT 3
- loosing custom piece of state in query parameters for list view URL when setFilter is called HOT 2
- Help to port for Flutter HOT 1
- testing-library fireEvent.change on Filter doesn't rerender the list HOT 1
- `sanitizeEmptyValues` does not support nested fields HOT 3
- Inputs are not displayed when using TabbedForm HOT 1
- testing bug with version 5 HOT 6
- [RA5] - Common Input Props are missing the "readOnly" prop, that was present in React Admin 4
- Login page is not showing on '/login' route HOT 3
- Query options not forwarded to getMany in ReferenceArrayInput HOT 3
- ra-data-fakerest doesn't log response to the console
- Ghost validation error when removing item from ArrayInput with nested ArrayInput HOT 3
- ra-data-simple-rest 5.0.2 produces error when installing packages HOT 3
- SimpleShowLayout does not pass resource to Labeled Component, translation fails HOT 3
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.