#3 -- allow cors requests

This commit is contained in:
Anton Romanov 2022-04-20 08:49:57 +04:00
parent c2396a7394
commit 19875f8971

View File

@ -3,6 +3,7 @@ package ru.ulstu.configuration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
@ -40,4 +41,9 @@ public class MvcConfiguration implements WebMvcConfigurer {
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(localeInterceptor()); registry.addInterceptor(localeInterceptor());
} }
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**");
}
} }