Z
Size: a a a
Z
M
Z
н
Z
def request(flow: http.HTTPFlow) -> None:
headers = {"Server": "Resin/3.1.9", "Cache-Control": "private",
"Set-Cookie": "JSESSIONID=abcgYiQfp1HPR5sfaoyDs; path=/", "Content-Type": "text/html",
"Date": "Sat, 13 Mar 2010 15:50:17 GMT"}
r = flow.request
if r.pretty_url == "http://www.minecraft.net/indev/":
with open("files/indev.html", "rb") as f:
index = f.read()
flow.response = http.HTTPResponse.make(200, index, headers)
if "http://www.minecraft.net/skin/" in r.pretty_url:
with open("files/Notch.png", 'rb') as f:
skin = f.read()
flow.response = http.HTTPResponse.make(200, skin, headers)
if "index.jsp?n=" in r.pretty_url or "/game/?n=" in r.pretty_url:
flow.response = http.HTTPResponse.make(200, b"1", headers)
if r.pretty_url == "http://www.minecraft.net/resources/":
with open("files/resources_2010/index.html") as f:
index = f.read()
flow.response = http.HTTPResponse.make(200, index, headers)
if "http://www.minecraft.net/resources/" in r.pretty_url and r.pretty_url[-4] == ".":
file_path = urllib.parse.unquote(r.pretty_url.split("/resources/")[1])
with open("files/resources_2010/%s" % file_path, "rb") as f:
file = f.read()
flow.response = http.HTTPResponse.make(200, file, headers)
if "listmaps" in r.pretty_url:
flow.response = http.HTTPResponse.make(200, b"-;-;-;-;-", headers)
SS
M
Б
Z
SS
SS
Z
Z
Z
SS
SS
Z
SS
SS