Files
nginx-unit/test/python/user_group/wsgi.py
2019-11-11 14:36:22 +00:00

19 lines
343 B
Python

import json
import os
def application(environ, start_response):
uid = os.geteuid()
gid = os.getegid()
out = json.dumps({
'UID': uid,
'GID': gid,
}).encode('utf-8')
start_response('200 OK', [
('Content-Length', str(len(out))),
('Content-Type', 'application/json')
])
return [out]