glassfish.wsgi.WSGITestApp.py Maven / Gradle / Ivy
# I'm a WSGI test app method thing!
def handle(environ, start_response):
if (environ["PATH_INFO"] == "/error"):
start_response("500 Internal Server Error",[('Content-Type', 'text/html'), ])
if (environ["PATH_INFO"] == "/notfound"):
start_response("404 Not Found",[('Content-Type', 'text/html'), ])
else :
start_response("200 OK", [('Content-Type', 'text/html'), ])
body = ["WSGI Test App Working!\n"]
for key in environ.keys():
content = str(key) + " is " + str(environ[key]) + "\n"
body.append(content)
return body