isoos / pwa

Progressive Web App library for Dart
https://pub.dartlang.org/packages/pwa
BSD 3-Clause "New" or "Revised" License
76 stars 18 forks source link

Access-Control error in service worker #11

Open jimmyff opened 7 years ago

jimmyff commented 7 years ago

After using my app for a while my HTTP requests start failing (with an XHR Error), if I inspect the service worker I can see this error in the console:

Request header field x-ijt is not allowed by Access-Control-Allow-Headers in preflight response.

If I delete the service worker my HTTP requests start going through correctly.

jimmyff commented 7 years ago

Just had the issue again, not sure if these help but see attached screenshots below. This is when when running on Dartium -I'm not sure if the issue also exists on Chrome.

screen shot 2017-06-28 at 15 01 13

screen shot 2017-06-28 at 15 01 22

isoos commented 7 years ago

@jimmyff: is there a simple to use http endpoint I could use for reproducing the issue?

shsun commented 5 years ago

It seems like IDE support plugin adds "x-ijt" header to all requests which makes them fail if server responds with "Access-Control-Allow-Headers".

Just allow x-ijt at server-side.