I am converting a panel app to HTML using the command
panel convert app.py --to pyodide-worker
and serving it from the localhost with
Cross-Origin-Opener-Policy
: same-origin
Cross-Origin-Embedder-Policy
: require-corp
The request and response headers for the main app.html look like:
[Request header]
GET /app.html HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: it-IT,it;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Host: localhost:8000
Pragma: no-cache
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
[Response header]
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.12.7
Date: Thu, 29 May 2025 09:30:43 GMT
Content-type: text/html
Content-Length: 19940
Last-Modified: Fri, 23 May 2025 13:08:16 GMT
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Then, when the page is loading, all the resources requested by the browser from https://cdn.holoviz.org/panel are blocked due to no cross-origin-resource-policy set by the server.
I attach the request and response headers just for the first resource that is being requested.
From Chrome:
and Firefox:
[Request header]
GET /panel/1.6.1/dist/bundled/reactiveesm/es-module-shims@%5E1.10.0/dist/es-module-shims.min.js HTTP/2
Host: cdn.holoviz.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Referer: http://localhost:8000/
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
Priority: u=2
[Response header]
HTTP/2 200
content-type: text/javascript
access-control-allow-origin: *
access-control-allow-methods: GET, POST, HEAD
last-modified: Fri, 14 Feb 2025 14:41:47 GMT
server: AmazonS3
x-amz-server-side-encryption: AES256
content-encoding: br
date: Wed, 28 May 2025 10:37:59 GMT
etag: W/"024dd597846c22ce6dbca8c3b251a7e6"
vary: accept-encoding
x-cache: Hit from cloudfront
via: 1.1 d6f2ecdfd53b40c1776d655bd15fdeb0.cloudfront.net (CloudFront)
x-amz-cf-pop: FRA60-P8
x-amz-cf-id: VGQoqbOwfRia8Bjtk_X-4W3viUM8JZM_ovx5GMiw-DVtfHk94MmNpw==
age: 79808
cache-control: max-age=31536000
X-Firefox-Spdy: h2
In my understanding the CDN should set cross-origin-resource-policy
: cross-origin
in the response header.
Hope this helps, otherwise let me know if I should provide more information.
Thanks