mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
Fix find_key_with_source (2231571657) (#3429)
This commit is contained in:
parent
a65e7c83b9
commit
8cf616643c
@ -34,11 +34,9 @@ class PersonalAPIKeyAuthentication(authentication.BaseAuthentication):
|
||||
authorization_match = re.match(fr"^{cls.keyword}\s+(\S.+)$", request.META["HTTP_AUTHORIZATION"])
|
||||
if authorization_match:
|
||||
return authorization_match.group(1).strip(), "Authorization header"
|
||||
if request_data is None and isinstance(request, Request):
|
||||
data = request.data
|
||||
else:
|
||||
data = request_data or {}
|
||||
if "personal_api_key" in data:
|
||||
data = request.data if request_data is None and isinstance(request, Request) else request_data
|
||||
|
||||
if data and "personal_api_key" in data:
|
||||
return data["personal_api_key"], "body"
|
||||
if "personal_api_key" in request.GET:
|
||||
return request.GET["personal_api_key"], "query string"
|
||||
|
Loading…
Reference in New Issue
Block a user