summaryrefslogtreecommitdiff
path: root/tests/staticfile.py
blob: a336ce7126d70b2e3d8584b72fdd1d00723e6f78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys

content_type = 'image/png'
filename = 'logo_uWSGI.png'

try:
    filename = sys.argv[1]
except IndexError:
    pass

try:
    content_type = sys.argv[2]
except IndexError:
    pass


def application(environ, start_response):
    start_response('200 OK', [('Content-Type', content_type)])
    fd = open(filename)
    yield environ['wsgi.file_wrapper'](fd, 32*1024)