fhttpy/index/test/index.pyp
2022-02-14 22:43:12 +01:00

33 lines
580 B
Python

global json
import json
response = '''<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #000000;
color: #ffffff;
font-size: 12px;
}
code {
background-color: #222222;
display: block;
}
</style>
</head>
<body>'''
for key in env:
value = str(env[key])
if value == "": value = " "
response += "<b>" +html.escape(key)+ ":</b><br>\n<code>" +html.escape(value)+ "</code><br>\n"
response += "</html>"
simpleResponse(
env["self"].connection,"200 OK",
{
"Content-Type": "text/html; charset=UTF-8",
},(response).encode("utf-8")
)