Skip to content

Commit

Permalink
fix access to app state
Browse files Browse the repository at this point in the history
  • Loading branch information
soof-golan committed Oct 10, 2024
1 parent 1e7fd0b commit aa8971a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/middleware/turnstile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def dispatch(
request.state.turnstile_outcome = TurnstileOutcome.NO_TOKEN()
return await call_next(request)

client = request.state.http_client
client = request.state.cf_http_client
response = await client.post(
"/turnstile/v0/siteverify/",
timeout=5,
Expand Down
3 changes: 2 additions & 1 deletion server/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@


class State(TypedDict):
http_client: httpx.AsyncClient
cf_http_client: httpx.AsyncClient
gh_http_client: httpx.AsyncClient
db: async_sessionmaker[AsyncSession]


Expand Down

0 comments on commit aa8971a

Please sign in to comment.