xref: /unit/test/python/environment/wsgi.py (revision 1848:4bd548074e2c)
1679Szelenkov@nginx.comimport os
2679Szelenkov@nginx.com
3*1848Szelenkov@nginx.com
4679Szelenkov@nginx.comdef application(env, start_response):
5679Szelenkov@nginx.com    body = ''
6679Szelenkov@nginx.com    vars = env.get('HTTP_X_VARIABLES').split(',')
7679Szelenkov@nginx.com
8679Szelenkov@nginx.com    for var in vars:
9679Szelenkov@nginx.com        if var in os.environ:
10679Szelenkov@nginx.com            body += str(os.environ[var]) + ','
11679Szelenkov@nginx.com
12679Szelenkov@nginx.com    body = body.encode()
13679Szelenkov@nginx.com    start_response('200', [('Content-Length', str(len(body)))])
14679Szelenkov@nginx.com    return body
15