瀏覽代碼

updating the webconfig

master
[email protected] 2 月之前
父節點
當前提交
4b8dd6f131
共有 1 個檔案被更改,包括 2 行新增6 行删除
  1. +2
    -6
      src/main/java/com/ffii/lioner/config/WebConfig.java

+ 2
- 6
src/main/java/com/ffii/lioner/config/WebConfig.java 查看文件

@@ -19,16 +19,12 @@ public class WebConfig implements WebMvcConfigurer {
.allowedOrigins(
"http://localhost", // If you test locally via Nginx at http://localhost
"http://127.0.0.1", // Sometimes browsers resolve localhost to 127.0.0.1
"http://20.2.170.164", // Look like no use
"http://10.40.0.4",
"http://20.2.170.164", // IP cloud
"http://localhost:3000" // If you ever run React dev server directly
// Add any other specific domains/IPs/ports where your frontend will be hosted
)
// You had .exposedHeaders("filename") - keep if you need to read custom response headers
.exposedHeaders("filename")
// You had .allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD") - This is missing "OPTIONS"
.allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS") // **** IMPORTANT: Add OPTIONS ****
// You had .allowedHeaders("*") duplicated - harmless, but the first one is enough
// .allowedHeaders("*")
.allowCredentials(true)
.maxAge(3600); // Recommended: Caches preflight results for 1 hour
}


Loading…
取消
儲存