penrose/penrose

feat: Absolute Image URLs may fail due to CORS

Open

#1,036 建立於 2022年5月31日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Haskell (4,756 star) (224 fork)batch import
good first issue

描述

Describe the bug Some web servers do not have CORS properly configured. While they may not intend to block cross-origin requests, they do. If a style program in the IDE references an image on one of these servers, then the browser will block the image fetch.

To Reproduce

  1. Open the IDE
  2. Load the tree-venn-3d example.
  3. Change both hrefs in tree-venn-3d.sty to https://www.cs.cmu.edu/~jssunshi/images/ball.svg and recompile.
  4. Observe the images do not load and the CORS errors in the developer tools console.

Expected behavior This actually is the expected behavior, but people may not appreciate the browser's behavior.

An alternative may be to proxy image fetches and add the CORS headers in the HTTP response headers in the cases where the web server does not have CORS configured. A further alternative is for affected websites to configure CORS to allow cross-origin requests.

貢獻者指南