>>> @replaceheader([(r'.*\.html', [('Content-type', 'text/html')])])
... def app(environ, start_response):
... start_response('200 OK',
... [('Content-type', 'text/plain')])
... return ['Hello, world!']
>>> import webtest
>>> app = webtest.TestApp(app)
>>> res = app.get('/a.txt')
>>> res.content_type
'text/plain'
>>> res = app.get('/a.html')
>>> res.content_type
'text/html'
>>> def xrds(environ):
... return [('X-XRDS', environ['wsgi.url_scheme'] + '://' +
environ['SERVER_NAME'] + '/svc.xrds')]
...
>>> def predicate(environ):
... return environ.get('HTTP_ACCEPT', '').find('application/xrds+xml') != -
1
...
>>> @addheader([(predicate, xrds)])
... def app(environ, start_response):
... start_response('200 OK',
... [('Content-type', 'text/plain')])
... return ['Hello, world!']
>>> app = webtest.TestApp(app)
>>> res = app.get('/')
>>> 'X-XRDS' in res.headers
False
>>> res = app.get('/', headers={'Accept':'application/xrds+xml'})
>>> res.headers['X-XRDS']
'http://localhost/svc.xrds'
Metadata
Release files for wsgiheaders 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wsgiheaders-0.2.zip | 5.5 kB | Without provenance | Details for wsgiheaders-0.2.zip |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wsgiheaders-0.2.win32.exe | Details for wsgiheaders-0.2.win32.exe | |||
| wsgiheaders-0.2-py2.6.egg | Legacy Egg format | - | - | Details for wsgiheaders-0.2-py2.6.egg |
Total release size: 81.7 kB
Release files / wsgiheaders-0.2.zip
| Download URL | wsgiheaders-0.2.zip |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3912aa2771a88396442e3b1f49b2b59431eb987fe9dc2f5791a609e515c2618
|
|
BLAKE2b-256 checksum How to use checksums |
eaefcf0e50316cb63bcdc876ed2ae78b67d3dcb711442a7532ff3f22838e6ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / wsgiheaders-0.2.win32.exe
| Download URL | wsgiheaders-0.2.win32.exe |
|---|---|
| Size | 71.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9dc27f021be99ced9d4127abbad46cb709f3297ef67d893e14fecfabf3c1030
|
|
BLAKE2b-256 checksum How to use checksums |
bbf3468e52d282fe024e5fcab6c9c15f9e46a502cfc60d758774ec4e51eca420
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / wsgiheaders-0.2-py2.6.egg
| Download URL | wsgiheaders-0.2-py2.6.egg |
|---|---|
| Size | 5.2 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
c687b0bad1a4cb55de71b87c5199b080d1423d782ee26ec8da87059da9ad596a
|
|
BLAKE2b-256 checksum How to use checksums |
39c72f3fa674825ff7439a68de0557aa091deecc22ec4ffb8baad4c821eb1088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wsgiheaders 0.2
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.