WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

Loading a FITS image from a different server doesn't work #176

Open astrofrog opened 6 years ago

astrofrog commented 6 years ago

I tried loading the following FITS file through the web client:

https://astropy.stsci.edu/data/photometry/irac_ch1_flight.fits

but this results in the following error in the Javascript console:

(index):1 Failed to load https://astropy.stsci.edu/data/photometry/irac_ch1_flight.fits: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://worldwidetelescope.org' is therefore not allowed access.
wwtsdk.min.js:33 Uncaught TypeError: Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'.
    at kd._readFromBlob$1 (wwtsdk.min.js:33)
    at kd.fileStateChange (wwtsdk.min.js:33)
    at Cc.e [as onStateChange] (wwtsdk.min.js:11)
    at Cc.set_state (wwtsdk.min.js:28)
    at Cc._loadBlob (wwtsdk.min.js:28)
    at XMLHttpRequest._xhr.onreadystatechange (wwtsdk.min.js:28)

We have the same issue in pywwt when trying to use loadFITS

pkgw commented 4 years ago

Part of this must have been HTTPS, but now I run into a CORS error. Shouldn't be too hard to fix with the improved URL-rewriting infrastructure ... famous last words?