sergiitk / pagerbeauty

:pager::sparkles: PagerDuty on-call widget for monitoring dashboard. Datadog and Grafana compatible
https://demo.pagerbeauty.sergii.org/v1/schedules/PDUQGYJ.html
MIT License
338 stars 27 forks source link

CORs issue in Firefox #93

Closed johntdyer closed 5 years ago

johntdyer commented 5 years ago

Describe the bug I am getting CORS errors when trying to run the app

Access to XMLHttpRequest at 'https://xxxoncall.herokuapp.com/v1/schedules/P2MB6K8.html?access_token=xxxxxxxecb18b163&theme=grafana' from origin 'https://grafana-achm4.xxxxxx.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

To Reproduce Steps to reproduce the behavior:

  1. Followed the docs
  2. Save and see image
  3. refresh and get error
  4. Consul shows CORs errors
sergiitk commented 5 years ago

Thank you for the report!

sergiitk commented 5 years ago

@johntdyer I just tried to verify the bug. To reproduced domain missmatch I used Grafana on running localhost and demo PagerBeauty on Heroku. I tried Firefox 62 and 65 and it worked in browsers: image

I believe you might have missed the part with setting method to iFrame: image

sergiitk commented 5 years ago

Please let me know if this helped!

johntdyer commented 5 years ago

Hello,

So its still happening

image

and here

image

When I build the panel it appears to work but then I refresh the dashboard and that is when it fails....

The config for the panel is

image

sergiitk commented 5 years ago

Hmmm. That's strange. I tried to reproduce this, but couldn't. Looking at the Request Error you posted, it does say method: IFRAME.

What firefox version are you using? Could you please also check if Chrome behave the same on your setup?

sergiitk commented 5 years ago

Ok, I even tried graphana running behind SSL. Still works fine: image

sergiitk commented 5 years ago

Also, try applyin "Image in IFrame load an image in an iframe " example and see if it works: image

sergiitk commented 5 years ago

Closed due to inactivity.