Skip to content

Commit

Permalink
Fix typing: Use of lambda caused typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Apr 9, 2024
1 parent 811d791 commit 4381075
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/aleph/vm/orchestrator/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ async def allow_cors_on_endpoint(request: web.Request):
)


async def http_not_found(request: web.Request):
"""Return a 404 error for unknown URLs."""
return web.HTTPNotFound()


app = web.Application(middlewares=[server_version_middleware])
cors = aiohttp_cors.setup(app)

Expand Down Expand Up @@ -110,9 +115,9 @@ async def allow_cors_on_endpoint(request: web.Request):
web.get("/status/check/ipv6", status_check_ipv6),
web.get("/status/config", status_public_config),
# Raise an HTTP Error 404 if attempting to access an unknown URL within these paths.
web.get("/about/{suffix:.*}", lambda _: web.HTTPNotFound()),
web.get("/control/{suffix:.*}", lambda _: web.HTTPNotFound()),
web.get("/status/{suffix:.*}", lambda _: web.HTTPNotFound()),
web.get("/about/{suffix:.*}", http_not_found),
web.get("/control/{suffix:.*}", http_not_found),
web.get("/status/{suffix:.*}", http_not_found),
# /static is used to serve static files
web.static("/static", Path(__file__).parent / "views/static"),
# /vm is used to launch VMs on-demand
Expand Down

0 comments on commit 4381075

Please sign in to comment.