Metadata-Version: 1.0
Name: wsgiheaders
Version: 0.1
Summary: Adding and replacing response headers
Home-page: http://www.bitbucket.org/aodag/wsgiheaders/
Author: Atsushi Odagiri
Author-email: aodagx@gmail.com
License: MIT License
Description: Adding and replacing response headers
        >>> @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')]
        ...
        >>> @addheader([('http://.*', xrds)])
        ... def app(environ, start_response):
        ...     start_response('200 OK',
        ...                    [('Content-type', 'text/plain')])
        ...     return ['Hello, world!']
        >>> app = webtest.TestApp(app)
        >>> res = app.get('/')
        >>> res.headers['X-XRDS']
        'http://localhost/svc.xrds'
        
        
Platform: UNKNOWN
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 3 - Alpha
