You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/waitress/tests/fixtureapps/writecb.py

15 lines
432 B

def app(environ, start_response): # pragma: no cover
path_info = environ['PATH_INFO']
if path_info == '/no_content_length':
headers = []
else:
headers = [('Content-Length', '9')]
write = start_response('200 OK', headers)
if path_info == '/long_body':
write(b'abcdefghij')
elif path_info == '/short_body':
write(b'abcdefgh')
else:
write(b'abcdefghi')
return []