Cors Issue while saving Js report template using Odata



  • Hi,
    We have hosted Js report studio in aws load balancer ,and we access jsreport studio via api gateway from our angular application.Using odata api it is possible to get all template,folders but it throws cors error while save jsreport template using odata api.
    How to enable cors using odata api?

    1_1631653425005_cors2.PNG 0_1631653425002_cors1.PNG


  • administrators

    hi! jsreport by default has CORS enabled, I have done a test from a simple app at localhost:4000 and jsreport running at localhost:5488 and everything works as expected, both the preflight (the one with request method OPTIONS) and the normal request (the one with request method PATCH) pass

    1.- Preflight request

    0_1631733831099_Captura de pantalla 2021-09-15 a la(s) 2.23.15 p. m..png

    2.- Save request

    0_1631733876263_Captura de pantalla 2021-09-15 a la(s) 2.24.03 p. m..png

    in your case it seems to be failing at the first request, which is the preflight request, since you have the api gateway in front of the jsreport server, it seems to me that this is a problem related to the api gateway, have you enabled CORS there? it seems to be easy to enable that in the console, maybe you are missing that step


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.