NEWS
[Solved] CORS error when executed from configuration page
-
I'm trying to make http requests from adapters config page (developed with react).
Here the http options:
const options = { method: 'post', body: body, logger: console, // mode: 'websocket', headers: { Connection: 'keep-alive', Accept: 'text/xml', Pragma: 'no-cache', SOAPAction: 'http://ws01.lom.ch/soap/listDP', 'Cache-Control': 'no-cache', 'Content-Type': 'text/xml; charset=utf-8', 'Content-Length': body.length, }, }; try { const response = await client.fetch('http://192.168.1.108/ws', options); .....
However I'm getting the following error message:
The very same code works from the adapter code (main.js), without any CORS errors.
Any ideas what I need to change when executing the code from react (adapter settings)?
-
Solved it myself. The configuration page is running in the browser, the adapter code itself is not. That's a separate process.
Btw. Is is possible to delete forum posts?
-
@sonusfaber only admins can delete.
Please edit your first post and add [Solved]