aodag / wsgiheaders

Adding and replacing response headers

Clone this repository (size: 15.0 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/aodag/wsgiheaders/

Changed (Δ88 bytes):

raw changeset »

setup.py (7 lines added, 4 lines removed)

Up to file-list setup.py:

1
1
from setuptools import setup, find_packages
2
2
import sys, os
3
3
4
version = '0.0.1'
4
version = '0.1'
5
5
6
6
setup(name='wsgiheaders',
7
7
      version=version,
@@ -22,7 +22,10 @@ Adding and replacing response headers
22
22
 >>> res = app.get('/a.html')
23
23
 >>> res.content_type
24
24
 'text/html'
25
 >>> @addheader([('.*', [('X-XRDS', 'http://localhost/services.xrds')])])
25
 >>> def xrds(environ):
26
 ...     return [('X-XRDS', environ['wsgi.url_scheme'] + '://' + environ['SERVER_NAME'] + '/svc.xrds')]
27
 ... 
28
 >>> @addheader([('http://.*', xrds)])
26
29
 ... def app(environ, start_response):
27
30
 ...     start_response('200 OK',
28
31
 ...                    [('Content-type', 'text/plain')])
@@ -30,7 +33,7 @@ Adding and replacing response headers
30
33
 >>> app = webtest.TestApp(app)
31
34
 >>> res = app.get('/')
32
35
 >>> res.headers['X-XRDS']
33
 'http://localhost/services.xrds'
36
 'http://localhost/svc.xrds'
34
37
35
38
""",
36
39
      classifiers=[
@@ -38,7 +41,7 @@ Adding and replacing response headers
38
41
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
39
42
        "Environment :: Web Environment",
40
43
        "License :: OSI Approved :: MIT License",
41
        "Development Status :: 2 - Pre-Alpha"
44
        "Development Status :: 3 - Alpha"
42
45
        ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
43
46
      keywords='',
44
47
      author='Atsushi Odagiri',