From 2d5adff1ead27f428e4e028692f37af6b9d24d15 Mon Sep 17 00:00:00 2001 From: kolya-t Date: Sat, 24 Mar 2018 00:03:14 +0300 Subject: [PATCH] allowed OPTIONS requests --- pom.xml | 2 +- .../org/teapot/backend/config/security/WebSecurityConfig.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ba3fe27..27a787f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 4.0.0 org.teapot teapot-backend - 3.0.1 + 3.0.2 jar diff --git a/src/main/java/org/teapot/backend/config/security/WebSecurityConfig.java b/src/main/java/org/teapot/backend/config/security/WebSecurityConfig.java index 1611533..334fb64 100644 --- a/src/main/java/org/teapot/backend/config/security/WebSecurityConfig.java +++ b/src/main/java/org/teapot/backend/config/security/WebSecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; +import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -20,6 +21,7 @@ public WebSecurityConfig() { @Override public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/h2/**"); + web.ignoring().antMatchers("/h2/**").and() + .ignoring().antMatchers(HttpMethod.OPTIONS, "/**"); } }