MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / handleRequest

Method handleRequest

src/Ui/UiServer.py:95–109  ·  view source on GitHub ↗
(self, env, start_response)

Source from the content-addressed store, hash-verified

93
94 # Handle WSGI request
95 def handleRequest(self, env, start_response):
96 path = bytes(env["PATH_INFO"], "raw-unicode-escape").decode("utf8")
97 if env.get("QUERY_STRING"):
98 get = dict(cgi.parse_qsl(env['QUERY_STRING']))
99 else:
100 get = {}
101 ui_request = UiRequest(self, get, env, start_response)
102 if config.debug: # Let the exception catched by werkezung
103 return ui_request.route(path)
104 else: # Catch and display the error
105 try:
106 return ui_request.route(path)
107 except Exception as err:
108 logging.debug("UiRequest error: %s" % Debug.formatException(err))
109 return ui_request.error500("Err: %s" % Debug.formatException(err))
110
111 # Reload the UiRequest class to prevent restarts in debug mode
112 def reload(self):

Callers 2

handleMessageMethod · 0.45
testActionFunction · 0.45

Calls 4

routeMethod · 0.95
error500Method · 0.95
UiRequestClass · 0.90
getMethod · 0.45

Tested by 1

testActionFunction · 0.36