xref: /unit/test/python/user_group/wsgi.py (revision 1848:4bd548074e2c)
1import json
2import os
3
4
5def application(environ, start_response):
6    uid = os.geteuid()
7    gid = os.getegid()
8
9    out = json.dumps({'UID': uid, 'GID': gid,}).encode('utf-8')
10
11    start_response(
12        '200 OK',
13        [
14            ('Content-Length', str(len(out))),
15            ('Content-Type', 'application/json'),
16        ],
17    )
18
19    return [out]
20