Skip to content

Commit

Permalink
feat : webconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
MyunghyunNero committed Nov 21, 2023
1 parent 141139e commit 3910f30
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/main/java/kusitms/gallae/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
package kusitms.gallae.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("Authorization", "Content-Type")
.exposedHeaders("Custom-Header")
.allowCredentials(true)
.maxAge(3600);
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(true);
}
}
}

0 comments on commit 3910f30

Please sign in to comment.