Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Parse and generate Content-Disposition headers; Fork of rfc6266 with bugfixes.
rfc6266-parser
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.
difference rfc6266
This module is a fork of rfc6266 which includes the latest bugfix
'NullHandler should be an instance, not a class' and bumped the
version to 0.0.5
.
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.4, Python 3.5, Python 3.6 and PyPy (1.7), PyPy(5.10.0) for Python3.
.. image:: https://secure.travis-ci.org/SWW13/python-rfc6266-parser.png
:target: https://secure.travis-ci.org/SWW13/python-rfc6266-parser
References
FAQs
Parse and generate Content-Disposition headers; Fork of rfc6266 with bugfixes.
We found that rfc6266-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.