Fix the issue of failing to obtain the link of uploaded images

This commit is contained in:
Liujian committed 2025-07-23 18:23:27 +08:00
1 parent 4d4f63a911
commit bf18fffc5a
10 files changed
+76 -13

No files matched your search

+6 -1
View File
@@ -36,7 +36,11 @@ class AuthMiddleware:
logger.debug(f"Skipping authentication for path: {path}")
await self.app(scope, receive, send)
return
for prefix_path in Config.NO_AUTH_PREFIX_PATH:
if path.startswith(prefix_path):
logger.debug(f"Skipping authentication for path prefix: {prefix_path}")
await self.app(scope, receive, send)
return
# Get headers
headers = scope.get("headers", [])
auth_header = None
@@ -63,6 +67,7 @@ class AuthMiddleware:
# Add user information to request state
scope["user"] = user
scope["user_token"] = token
except Exception as e:
logger.error(f"Authentication error: {str(e)}")