mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Respect existing scope["actor"] if set, closes #854
This commit is contained in:
parent
d2aef9f7ef
commit
6151c25a5a
4 changed files with 22 additions and 1 deletions
|
|
@ -908,6 +908,7 @@ class DatasetteRouter(AsgiRouter):
|
|||
):
|
||||
scope_modifications["scheme"] = "https"
|
||||
# Handle authentication
|
||||
default_actor = scope.get("actor") or None
|
||||
actor = None
|
||||
for actor in pm.hook.actor_from_request(
|
||||
datasette=self.ds, request=Request(scope, receive)
|
||||
|
|
@ -918,7 +919,7 @@ class DatasetteRouter(AsgiRouter):
|
|||
actor = await actor
|
||||
if actor:
|
||||
break
|
||||
scope_modifications["actor"] = actor
|
||||
scope_modifications["actor"] = actor or default_actor
|
||||
return await super().route_path(
|
||||
dict(scope, **scope_modifications), receive, send, path
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue