Make cors policy dependent orn tauri mode

This commit is contained in:
Connor Yoh 2025-07-01 16:21:33 +01:00
parent 7055f135bb
commit 4c5ddd6cce

View File

@ -30,15 +30,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") if (Boolean.parseBoolean(System.getProperty("STIRLING_PDF_TAURI_MODE", "false"))) {
.allowedOrigins( registry.addMapping("/**")
"http://localhost:3000", .allowedOrigins("http://localhost:5173", "http://tauri.localhost")
"http://localhost:5173", .allowedMethods("*")
"http://tauri.localhost", .allowedHeaders("*");
"tauri://localhost", }
"app://localhost",
"file://")
.allowedMethods("*")
.allowedHeaders("*");
} }
} }