text stringlengths 1 93.6k |
|---|
if re.match(r"^\/api\/menu$", self.path):
|
return self.api_menu()
|
if re.match(r"^\/api\/themes$", self.path):
|
return self.api_theme_settings()
|
if re.match(r"^\/api\/hostname$", self.path):
|
return self.api_hostname()
|
if re.match(r"^\/api\/settings\/view$", self.path):
|
return self.api_view_settings()
|
if re.match(r"^\/api\/pkglist$", self.path):
|
return self.api_pkg_list()
|
if re.match(r"^\/$", self.path) or re.match(r"^\/index\.html$", self.path) or re.match(r"^\/document\/[a-zA-Z\-]{2,5}\/(ps4|ps5|psvita)\/index.html$", self.path):
|
return self.index()
|
if re.match(r"^\/rpi$", self.path):
|
return self.rpi()
|
if re.match(r"^\/pkgs[\/]?", self.path):
|
return self.pkgs()
|
if re.match(r"\/favicon.ico$", self.path):
|
return self.favicon()
|
if re.match(r"\/robots.txt$", self.path):
|
return self.robots()
|
if re.match(r"\/sitemap.xml$", self.path):
|
return self.sitemap()
|
if re.search(r"\/redirect\.manifest$", self.path):
|
return self.redirect_manifest()
|
if re.search(r"\/theme\.manifest$", self.path):
|
return self.theme_manifest()
|
if re.match(r"^\/cache\/.*\/index.html$", self.path):
|
return self.generate_cacher()
|
if re.match(r"^\/cache\/.*\/offline.manifest$", self.path):
|
return self.generate_manifest()
|
if re.match(r"^\/exploits\/.*\/", self.path):
|
return self.exploit()
|
if re.match(r"^\/success$", self.path):
|
return self.success()
|
if re.match(r"^\/success\/[0-9]{1,5}\/[0-9]{1,3}\/.*$", self.path):
|
return self.success_args()
|
if re.match(r"^\/themes\/", self.path):
|
return self.static_request()
|
if re.match(r"^\/api\/news$", self.path):
|
return self.news()
|
if re.match(r"^\/blank.html$", self.path):
|
return self.blank()
|
if re.match(r"^\/debug\/var\/[a-zA-Z0-9\-_\.]*$", self.path) and not SETTINGS["Public"]:
|
return self.debug_var_get()
|
if re.match(r"\/debug\/varclear$", self.path) and not SETTINGS["Public"]:
|
return self.debug_varclear()
|
if re.match(r"\/debug\/clearlogs$", self.path) and not SETTINGS["Public"]:
|
return self.debug_clearlogs()
|
return self.my_send_error(404)
|
def parse_POST(self):
|
try:
|
# TODO: Fix this... no one uses it anyway
|
# ctype, pdict = parse_header(self.headers['content-type'])
|
# if ctype == 'multipart/form-data':
|
# postvars = parse_multipart(self.rfile, pdict)
|
# elif...
|
if self.headers["content-type"] == "application/x-www-form-urlencoded": # ctype == 'application/x-www-form-urlencoded':
|
length = int(self.headers["content-length"])
|
postvars = parse_qs(self.rfile.read(length), keep_blank_values=1)
|
elif self.headers["content-type"] == "application/json": # ctype == 'application/json':
|
length = int(self.headers["content-length"])
|
postvars = json.loads(self.rfile.read(length))
|
# TODO: Can we make these b'' strings to match?
|
else:
|
postvars = {}
|
except (KeyError, TypeError, json.decoder.JSONDecodeError):
|
postvars = {}
|
# TODO: Standardize parsed data
|
return postvars
|
def do_POST(self):
|
if re.match(r"^\/networktest\/post_128", self.path): # Preempting this prior to reading data to avoid a 414 error response
|
return self.empty_response()
|
if re.match(r"^\/$", self.path) or re.match(r"^\/index\.html$", self.path) or re.match(r"^\/document\/[a-zA-Z\-]{2,5}\/(ps4|ps5|psvita)\/index.html$", self.path):
|
return self.index()
|
post_data = self.parse_POST()
|
if re.match(r"^\/api\/settings\/edit$", self.path):
|
return self.api_edit_settings(post_data)
|
if re.match(r"^\/debug\/jserrorlog$", self.path):
|
return self.debug_jserrorlog(post_data)
|
if re.match(r"^\/debug\/filedump$", self.path) and not SETTINGS["Public"]:
|
return self.debug_filedump(post_data)
|
if re.match(r"^\/debug\/filedelete$", self.path) and not SETTINGS["Public"]:
|
return self.debug_filedelete(post_data)
|
if re.match(r"\/debug\/vardump$", self.path) and not SETTINGS["Public"]:
|
return self.debug_vardump(post_data)
|
if re.match(r"^\/debug\/var\/[a-zA-Z0-9\-_\.]*$", self.path) and not SETTINGS["Public"]:
|
return self.debug_var_post(post_data)
|
return self.my_send_error(404)
|
def log_message(self, fmt, *args): # pylint: disable=arguments-differ
|
if (fmt % args) == "code 404, message Not Found":
|
return
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.