Skip to main content

rfc6266

This module parses and generates HTTP Content-Disposition headers. These headers are used when getting resources for download; they provide a hint of whether the file should be downloaded, and of what filename to use when saving.

Usage

Receiver

parse_headers builds a ContentDisposition object from the Content-Disposition header and (as a fallback) the document location. Shortcuts work with response objects from httplib2 and the requests library.

Important attributes of ContentDisposition are is_inline, filename_unsafe, filename_sanitized.

Sender

build_header builds a header value from a filename.

Security

The Content-Disposition filename should be used with caution. Do not let the sender overwrite an arbitrary filesystem location, pick arbitrary extensions or filenames with special meaning, pick filenames containing unusual or misleading characters, etc. Read RFC 6266 section 4.3 for more details.

Testing

To test in the current Python implementation:

py.test

To test compatibility across Python releases:

tox

rfc6266 is currently tested under Python 2.7, Python 2.6, Python 3.3, Python 3.2, and PyPy (1.7).

https://secure.travis-ci.org/g2p/rfc6266.png

References

Metadata

Release files for rfc6266-content-disposition 0.0.6

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

Source distribution (sdist)

Source distribution for rfc6266-content-disposition 0.0.6
File Size Uploaded Provenance Actions
rfc6266-content-disposition-0.0.6.tar.gz 8.3 kB Without provenance Details for rfc6266-content-disposition-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rfc6266-content-disposition 0.0.6
File Interpreter ABI Platform Actions
rfc6266_content_disposition-0.0.6-py3-none-any.whl Python 3 none any Details for rfc6266_content_disposition-0.0.6-py3-none-any.whl

Total release size: 32.8 kB

Release files / rfc6266-content-disposition-0.0.6.tar.gz

Download URL rfc6266-content-disposition-0.0.6.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f063e39c8d59f402facda2f58ecc7f0430443e9364fd246384009ea2af03f788
BLAKE2b-256 checksum
How to use checksums
ea48154f0c4ee831f657790a4013b05996a888e6f2b6f4605924d24a9a5fe12a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / rfc6266_content_disposition-0.0.6-py3-none-any.whl

Download URL rfc6266_content_disposition-0.0.6-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fef8ff8ebe08e17e3998c91ce3a273d9c0acbe900958326baf62eb376072fd2
BLAKE2b-256 checksum
How to use checksums
83a76eed63b4f0a9e738090b7761ddbc673056d9d50eaa9a909f93b65e9817af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Security for rfc6266-content-disposition 0.0.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

0.0.6 This release

2 release files No 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