diff --git a/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java b/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java index b86f7b3ec..2ad0d8c98 100644 --- a/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java +++ b/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java @@ -30,15 +30,11 @@ public class WebMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins( - "http://localhost:3000", - "http://localhost:5173", - "http://tauri.localhost", - "tauri://localhost", - "app://localhost", - "file://") - .allowedMethods("*") - .allowedHeaders("*"); + if (Boolean.parseBoolean(System.getProperty("STIRLING_PDF_TAURI_MODE", "false"))) { + registry.addMapping("/**") + .allowedOrigins("http://localhost:5173", "http://tauri.localhost") + .allowedMethods("*") + .allowedHeaders("*"); + } } }