Polymer 3 CORS with iron-ajax

160 Views Asked by At

I am trying to make an get call using iron-ajax as follows:

<iron-ajax
    id="getLogsAjax"
    url="http://localhost:51806/{{logPath}}"
    method="get"
    handle-as="text"
    last-response="{{logResponse}}">
 </iron-ajax>

But am getting the following error: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access

I see this was solved on an older version of Polymer but the byutv-jsonp library used there is now outdated. Any idea how to solve this with Polymer 3.0?

0

There are 0 best solutions below