Skip to content

Commit

Permalink
Implements CorsSupport in SpringBoot (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
iroqueta authored Dec 5, 2024
1 parent 878b5a2 commit 9d8addf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gxspringboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<groupId>${project.groupId}</groupId>
<artifactId>gxclassR</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>${project.groupId}</groupId>
<artifactId>gxwrapperjavax</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
10 changes: 10 additions & 0 deletions gxspringboot/src/main/java/com/genexus/springboot/GXConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.genexus.common.interfaces.SpecificImplementation;
import com.genexus.diagnostics.core.ILogger;
import com.genexus.diagnostics.core.LogManager;
import com.genexus.servlet.CorsFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -51,6 +52,15 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
}
}

@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
FilterRegistrationBean<CorsFilter> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new CorsFilter());
registrationBean.addUrlPatterns("/*");
return registrationBean;
}


@Bean
public FilterRegistrationBean<UrlRewriteFilter> urlRewriteFilter() {
FilterRegistrationBean<UrlRewriteFilter> registrationBean = new FilterRegistrationBean<>();
Expand Down

0 comments on commit 9d8addf

Please sign in to comment.