Skip to main content
Pboot

pboot-cors

pboot-cors 是 Pboot 的跨域资源共享(CORS)扩展。

基于 flask-cors 4.0.1 移植, API 与配置项保持一致,仅将框架依赖从 flask 换为 pboot。

安装

$ pip install pboot-cors

用法

全局启用

from pboot import Pboot
from pboot_cors import CORS

app = Pboot(__name__)

CORS(app, resources={r"/api/*": {
    "origins": "*",
    "allow_headers": ["Content-Type", "Authorization"],
    "expose_headers": ["Content-Disposition"],
    "supports_credentials": False,
}})

装饰器

from pboot_cors import cross_origin

@app.route("/api/data")
@cross_origin(origins="*")
def data():
    return {"ok": True}

与 flask-cors 的差异

项目 flask-cors pboot-cors
导入名 from flask_cors import CORS from pboot_cors import CORS
框架依赖 flask pboot>=3.2.0
配置项 CORS_* CORS_*(完全一致)
内部标记 _FLASK_CORS_EVALUATED _PBOOT_CORS_EVALUATED

配置项、CORS(app, ...) 参数、cross_origin 装饰器行为均与 flask-cors 一致, 可直接参考其文档。

许可证

MIT,详见 LICENSE。

上游项目 flask-cors 由 Cory Dolphin 开发,MIT 协议,版权归原作者所有。

Metadata

Release files for pboot-cors 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pboot-cors 1.0.0
File Size Uploaded Provenance Actions
pboot_cors-1.0.0.tar.gz 11.6 kB With provenance Details for pboot_cors-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pboot-cors 1.0.0
File Interpreter ABI Platform Actions
pboot_cors-1.0.0-py3-none-any.whl Python 3 none any Details for pboot_cors-1.0.0-py3-none-any.whl

Total release size: 24.8 kB

Release files / pboot_cors-1.0.0.tar.gz

Download URL pboot_cors-1.0.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fcde61b8cc179fa5d813e838956b1092323aa75b94fd347ab80c3c3fa20de24d
BLAKE2b-256 checksum
How to use checksums
dbcf30b33d1168053344435174f2881c7a3fdeaaeda082a867187124e6487adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pboot_cors-1.0.0-py3-none-any.whl

Download URL pboot_cors-1.0.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f011dbcbcf7f279ca3f9fc14055a48c1ee02b0db4e60a048d4758dfcc6028260
BLAKE2b-256 checksum
How to use checksums
235b4980a66424be0ce5b665f4005cdee1625c94a83a768b0379454877fa4c73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for pboot-cors 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pboot_cors-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page