summaryrefslogtreecommitdiffhomepage
path: root/test/python/environment/wsgi.py
blob: 91e0ba4914026a8f43d87632039d0df986368633 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import os


def application(env, start_response):
    vars = env.get('HTTP_X_VARIABLES').split(',')

    body = ','.join([str(os.environ[var]) for var in vars if var in os.environ])
    body = body.encode()

    start_response('200', [('Content-Length', str(len(body)))])
    return body