fix: OpenAPI authentication (#4110)
parent
3e8bf8a631
commit
801891de82
|
|
@ -115,7 +115,8 @@ content = """
|
||||||
|
|
||||||
class DocHeadersMiddleware(MiddlewareMixin):
|
class DocHeadersMiddleware(MiddlewareMixin):
|
||||||
def process_response(self, request, response):
|
def process_response(self, request, response):
|
||||||
if request.path.startswith('/doc/') or request.path.startswith('/doc_chat/'):
|
if request.path.startswith(CONFIG.get_admin_path() + '/api-doc/') or request.path.startswith(
|
||||||
|
CONFIG.get_chat_path() + '/api-doc/'):
|
||||||
auth = request.COOKIES.get('Authorization')
|
auth = request.COOKIES.get('Authorization')
|
||||||
if auth is None:
|
if auth is None:
|
||||||
return HttpResponse(content)
|
return HttpResponse(content)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue