Dispatch the requests.
(
self, environ: WSGIEnvironment, start_response: StartResponse
)
| 538 | return Response("") |
| 539 | |
| 540 | def __call__( |
| 541 | self, environ: WSGIEnvironment, start_response: StartResponse |
| 542 | ) -> t.Iterable[bytes]: |
| 543 | """Dispatch the requests.""" |
| 544 | # important: don't ever access a function here that reads the incoming |
| 545 | # form data! Otherwise the application won't have access to that data |
| 546 | # any more! |
| 547 | request = Request(environ) |
| 548 | response = self.debug_application |
| 549 | if request.args.get("__debugger__") == "yes": |
| 550 | cmd = request.args.get("cmd") |
| 551 | arg = request.args.get("f") |
| 552 | secret = request.args.get("s") |
| 553 | frame = self.frames.get(request.args.get("frm", type=int)) # type: ignore |
| 554 | if cmd == "resource" and arg: |
| 555 | response = self.get_resource(request, arg) # type: ignore |
| 556 | elif cmd == "pinauth" and secret == self.secret: |
| 557 | response = self.pin_auth(request) # type: ignore |
| 558 | elif cmd == "printpin" and secret == self.secret: |
| 559 | response = self.log_pin_request(request) # type: ignore |
| 560 | elif ( |
| 561 | self.evalex |
| 562 | and cmd is not None |
| 563 | and frame is not None |
| 564 | and self.secret == secret |
| 565 | and self.check_pin_trust(environ) |
| 566 | ): |
| 567 | response = self.execute_command(request, cmd, frame) # type: ignore |
| 568 | elif ( |
| 569 | self.evalex |
| 570 | and self.console_path is not None |
| 571 | and request.path == self.console_path |
| 572 | ): |
| 573 | response = self.display_console(request) # type: ignore |
| 574 | return response(environ, start_response) |
nothing calls this directly
no test coverage detected