Skip to content

Commit

Permalink
Update CorsConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mschulte-tsi authored Jul 27, 2021
1 parent 02ae6c4 commit b278bd0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package eu.europa.ec.dgc.businessrule.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@RequiredArgsConstructor
@Configuration
public class CorsConfig implements WebMvcConfigurer {
private final DgcConfigProperties dgcConfigProperties;

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*");
registry.addMapping("/**").allowedOrigins(dgcConfigProperties.getAllowedCorsUrls()).allowedMethods("*");
}

}
}

0 comments on commit b278bd0

Please sign in to comment.