mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-31 02:02:48 +00:00
feat: Modify the dialogue apikey generation rules (#4583)
This commit is contained in:
parent
9586c1b6de
commit
36bbacf518
|
|
@ -25,7 +25,9 @@ class CrossDomainMiddleware(MiddlewareMixin):
|
|||
def process_response(self, request, response):
|
||||
auth = request.META.get('HTTP_AUTHORIZATION')
|
||||
origin = request.META.get('HTTP_ORIGIN')
|
||||
if auth is not None and str(auth).startswith("Bearer application-") and origin is not None:
|
||||
|
||||
if auth is not None and any([str(auth).startswith(prefix) for prefix in
|
||||
['Bearer application-', 'Bearer agent-']]) and origin is not None:
|
||||
application_api_key = get_application_api_key(str(auth), True)
|
||||
cross_domain_list = application_api_key.get('cross_domain_list', [])
|
||||
allow_cross_domain = application_api_key.get('allow_cross_domain', False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue