superset
superset copied to clipboard
fix(Dashboard): PDF/Image download CORS issues via image proxy
SUMMARY
A dashboard can have an image attached in the markdown component that is hosted on a server that does not have proper CORS settings. Due to limitations of html2canvas, both PDF and image download will fail.
For reference from html2canvas:
All the images that the script uses need to reside under the same origin for it to be able to read them without the assistance of a proxy. Similarly, if you have other canvas elements on the page, which have been tainted with cross-origin content, they will become dirty and no longer readable by html2canvas.
This PR introduces an img_proxy view that can be used to overcome the CORS issues.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N.A.
TESTING INSTRUCTIONS
- Attach an image in the dashboard that does not have proper CORS settings
- Download the dashboard as PDF or image
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API