Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【功能请求】不屏蔽 pyodide 包下面的 zip 文件 #331

Open
ccbikai opened this issue Dec 16, 2024 · 1 comment
Open

【功能请求】不屏蔽 pyodide 包下面的 zip 文件 #331

ccbikai opened this issue Dec 16, 2024 · 1 comment

Comments

@ccbikai
Copy link
Contributor

ccbikai commented Dec 16, 2024

Pyodide 支持在浏览器内运行 Python。

加载运行环境或者标准库的时候,使用的是 zip 格式。

通过 CDN 加载 https://registry.npmmirror.com/pyodide/0.26.4/files/pyodide.js 的时候没问题。
但是加载 ZIP 文件 https://registry.npmmirror.com/pyodide/0.26.4/files/python_stdlib.zip ,就会返回 451 Unavailable For Legal Reasons

能否为 pyodide 下的 ZIP 文件开放白名单。

https://npmmirror.com/package/pyodide/files?version=0.26.4

@ccbikai
Copy link
Contributor Author

ccbikai commented Dec 16, 2024

可能还得支持跨域 access-control-allow-origin:*

curl -I https://cdn.jsdelivr.net/pyodide/v0.26.4/full/packaging-23.2-py3-none-any.whl 这是 jsdelivr 的响应,目前是可以正工作的

HTTP/1.1 200 Connection established

HTTP/2 200
access-control-allow-origin: *
access-control-expose-headers: *
timing-allow-origin: *
cache-control: public, max-age=31536000
cross-origin-resource-policy: cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=31536000; includeSubDomains; preload
content-type: application/wasm
etag: "3993ce2e1eaf8932b24c278129df2ed5"
last-modified: Fri, 15 Nov 2024 16:56:39 GMT
accept-ranges: bytes
age: 75308
date: Mon, 16 Dec 2024 11:58:46 GMT
x-served-by: cache-fra-etou8220113-FRA, cache-sin-wsss1830067-SIN
x-cache: HIT, MISS
vary: Accept-Encoding
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
content-length: 194236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant