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?
-
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]
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden