From 9c51e666f87498364eed568dd8d7232208384e27 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Mon, 18 May 2026 16:10:49 +0800 Subject: [PATCH] fix(file-service): permit /error endpoint to avoid 401 on server errors Spring Boot's /error handler was secured, causing any server-side exception during upload/serve to redirect clients to login instead of returning an error message. Permitting /error ensures errors are returned as proper JSON responses rather than auth challenges. Co-Authored-By: Claude Sonnet 4.6 --- .../src/main/java/com/xuqm/file/config/SecurityConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/file-service/src/main/java/com/xuqm/file/config/SecurityConfig.java b/file-service/src/main/java/com/xuqm/file/config/SecurityConfig.java index af90a50..462951f 100644 --- a/file-service/src/main/java/com/xuqm/file/config/SecurityConfig.java +++ b/file-service/src/main/java/com/xuqm/file/config/SecurityConfig.java @@ -40,6 +40,7 @@ public class SecurityConfig { .requestMatchers(new AntPathRequestMatcher("/api/file/*/thumbnail", "GET")).permitAll() .requestMatchers(new AntPathRequestMatcher("/api/file/*", "GET")).permitAll() .requestMatchers(new AntPathRequestMatcher("/actuator/**", "GET")).permitAll() + .requestMatchers(new AntPathRequestMatcher("/error")).permitAll() .anyRequest().authenticated() ) .exceptionHandling(ex -> ex