I have setup a subroutine endpoint to my database but on trying to perform a POST action in an intranet webpage it is getting a CORS error and going through a preflight. Is there a way to configure the server to allow cross origin?
nb. MVIS and apache are running on the same machine
Page 1 / 1
I have setup a subroutine endpoint to my database but on trying to perform a POST action in an intranet webpage it is getting a CORS error and going through a preflight. Is there a way to configure the server to allow cross origin?
nb. MVIS and apache are running on the same machine
nb. MVIS and apache are running on the same machine
<add name="Access-Control-Allow-Origin" value="*" />
Apache will have something similar.
Cheers,
Brian
I have setup a subroutine endpoint to my database but on trying to perform a POST action in an intranet webpage it is getting a CORS error and going through a preflight. Is there a way to configure the server to allow cross origin?
nb. MVIS and apache are running on the same machine
nb. MVIS and apache are running on the same machine
MVIS is the backend API / server which is where the CORS issue is. I was asking if there was a way to do what you are suggesting thinking there would be some sort of config file I couldn't find in the doco where we could add in custom headers.
Nb. Since creating this question I have logged a support ticket with Rocket and they have responded that it is currently unable to do it and it is with development. They did suggest some workarounds which was to setup a proxy and call that instead and for that to deal with CORS issue
https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9
https://gist.github.com/jesperorb/6ca596217c8dfba237744966c2b5ab1e
As we were developing with apache we have currently gone with this (until there is fix/update to MVIS)
https://chriscarey.com/blog/2014/06/13/apache-proxy-with-cors-headers/
I have setup a subroutine endpoint to my database but on trying to perform a POST action in an intranet webpage it is getting a CORS error and going through a preflight. Is there a way to configure the server to allow cross origin?
nb. MVIS and apache are running on the same machine
nb. MVIS and apache are running on the same machine
But as your articles state, allowing all cross-origin requests is probably not a good idea. If it is only for an intranet, it is probably OK, but not a good idea for a public facing website. Ultimately, using a proxy is probably safer.
Cheers,
Brian
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.