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)
- NumberInput's `onBlur` prop does not provide an event object HOT 2
- Add ability to customize query string format for lists HOT 5
- i want to show the received gmail in react js app
- AutoComplete choice listing issue when using useChoicesContext HOT 1
- react admin error with Menu.Item missing properties HOT 6
- storeKey prop is not passed to useRecordSelection hook inside useListController HOT 5
- useEditContext returns null for both values HOT 5
- Infinite loop occurs in page rendering when perPage is set to a negative number in List Component HOT 2
- Codemods are not included in ra-core v5
- Duplicate entries in documentation search HOT 2
- `<PasswordInput/>` or `<TextInput/>` has corrupted `validate` prop, if field is handled with `disabled` prop HOT 4
- Auth provider login Promise rejection with "message" doesn't trigger notification message HOT 1
- When we use useRedirect hook to go back to a List Component, the pagination is reseted to page 1
- <AutocompleteInput> and <AutocompleteInputArray> refetch choises passed from graphql HOT 1
- Fields inside the ArrayInput aren't set as dirty when built HOT 1
- When a form contains ArrayInput with large entries. It takes more than a minute for a form to be submitted. HOT 2
- Bug in Translation in post edit page showing (post "some text here") HOT 1
- Dark mode become default upgrading react-admin package HOT 1
- AutocompleteInput with ReferenceInput calling getList() two times after select on sugestion list HOT 1
- Clearing filters using setFilter({}) does not clear FilterLiveSearch text input
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.