Klaus Demo ~jonashaag/bjoern / 261d3a6 tests / all-kinds-of-errors.py
261d3a6

Tree @261d3a6 (Download .tar.gz)

all-kinds-of-errors.py @261d3a6raw · history · blame

import random

def invalid_header_type(environ, start_response):
    start_response('200 ok', None)
    return ['yo']

def invalid_header_tuple(environ, start_response):
    tuples = {1: (), 2: ('a', 'b', 'c'), 3: ('a',)}
    start_response('200 ok', [tuples[random.randint(1, 3)]])
    return ['yo']

def invalid_header_tuple_item(environ, start_response):
    start_response('200 ok', (object(), object()))
    return ['yo']

import bjoern
bjoern.run(invalid_header_type, '0.0.0.0', 8080)