CORS Policy Error when trying to pass auth header inside the request
In ProgressHi guys!
We are working on the ptz feature inside web app and when we try to send a request to nx witness we are getting the following error:
Access to fetch at 'https://localhost:7001/api/ptz?cameraId={46c106d7-dbbc-9b5a-e3b5-6f7fa65d0d00}&command=GetToursPtzCommand' from origin 'https://localhost:8081/' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
We have tried to google it and set it up in web admin advanced settings but it gave no result.
Can you help us with that problem pls?
P.S. we tried to use it in postman and it works great but in browser it gave the error on the screen.
-
Hello,
Change either the name/address of the Server or the name/address which your application is hosting at.
In other words, there should not be localhost and localhost.
Hi! Thanks for the answer. I have tried to change the IP addresses of the apps and I still have the same error.
Also, I have tried to separate the client and server apps to different machines on the same local network but I still have that error with CORS. Both servers have SSL certificates.
Is it possible to configure CORS policy inside the nx witness?
Please sign in to leave a comment.
Comments
2 comments