INNER CODE UNIT · Python
IncomingHandler
nolabs-ai/deepfabric · tools-sdk/components/github/app.py:617
class IncomingHandler(http.IncomingHandler):
def handle_request(self, request: http.Request) -> http.Response:
"""Handle incoming HTTP requests."""
# Strip the /github prefix if present (Spin routing includes it)
path = request.uri
if path.startswith("/github"):
path = path[7:] # Remove "/github" prefix
if not path:
path = "/"
method = request.method
# Health check
if path == "/health" and method == "GET":
# Check if token is configured
token = get_github_token()
token_ok = bool(token and token != "{{ github_token }}") # noqa: S105
allowed_repos = get_allowed_repos()