fix: OpenAPI authentication (#4110)

This commit is contained in:
shaohuzhang1 2025-09-25 17:16:39 +08:00 committed by GitHub
parent 3e8bf8a631
commit 801891de82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,7 +115,8 @@ content = """
class DocHeadersMiddleware(MiddlewareMixin):
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')
if auth is None:
return HttpResponse(content)