Closed i10111pn closed 4 years ago
Hi,
AFAIK, the CORS config cannot be set by using NUXEO_CUSTOM_PARAM
env variable, you need to add a new config file with the expected contribution/configuration.
See https://doc.nuxeo.com/nxdoc/910/cross-origin-resource-sharing-cors/ for the related documentation.
BTW, you should run the latest version of Nuxeo, nuxeo:10.10
.
Thanks!
Launching docker image with cors config file fixed the issue.
docker run --name mynuxeo --user nuxeo:nuxeo --mount type=bind,source="/home/i10111pn/Configs/cors-config.xml",target=/opt/nuxeo/server/templates/docker/config/cors-config.xml.nxftl --rm -ti -p 8080:8080 -e NUXEO_PACKAGES="nuxeo-web-ui" nuxeo:9.10
Where cors-config.xml
:
<component name="org.nuxeo.cors.config">
<extension target="org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService" point="corsConfig">
<corsConfig name="all" supportedMethods ="GET,POST,HEAD,OPTIONS,DELETE,PUT">
<pattern>/nuxeo/.*</pattern>
</corsConfig>
</extension>
</component>
Hi.
I have a react application that is trying to connect to the nuxeo ui. Nuxeo is launched by a docker command:
docker run --name mynuxeo --rm -ti -p 8080:8080 -e NUXEO_PACKAGES="nuxeo-web-ui nuxeo-showcase-content nuxeo-template-rendering nuxeo-template-rendering-samples" -e NUXEO_CUSTOM_PARAM="org.nuxeo.dev=true\nallowOrigin=http://localhost:3000\nallowSubdomains=true\nsupportedMethods=GET,POST,HEAD,OPTIONS" nuxeo:9.10
and accessible in the browser at http://172.17.0.2:8080/nuxeo/ or http://localhost:8080/nuxeo/.
The react application is created by create-react-app. My
package.json:
Inside of the react application, I have the next code:
Which is producing next error:
I believe the root of the problem is in nuxeo.js file at line 126:
Because inside of the
options
I'm passingmode
option which is not copied to thefetchOptions
When I manually edit
nuxeo.js
(inside mynode_modules
) to pass themode
option it fixes the CORS problem:Can you please add the ability to pass
mode
option?