diff --git a/build.gradle b/build.gradle index 343bcf4..ab110f2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,19 +1,22 @@ group 'com.poprosturonin' -version '1.0-SNAPSHOT' +version '' buildscript { + ext { + springBootVersion = '2.0.0.BUILD-SNAPSHOT' + } repositories { mavenCentral() + maven { url 'https://repo.spring.io/libs-snapshot' } } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.1.RELEASE") + classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" } } apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' +apply plugin: 'io.spring.dependency-management' jar { baseName = 'memes-api' @@ -22,6 +25,7 @@ jar { repositories { mavenCentral() + maven { url 'https://repo.spring.io/libs-snapshot' } } sourceCompatibility = 1.8 @@ -31,7 +35,7 @@ dependencies { compile 'org.jsoup:jsoup:1.10.1' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' compile group: 'org.json', name: 'json', version: '20140107' - compile("org.springframework.boot:spring-boot-starter-web") + compile 'org.springframework.boot:spring-boot-starter-web' compile('org.springframework.boot:spring-boot-starter-security') compile("org.springframework.boot:spring-boot-starter-actuator") compile("org.springframework.boot:spring-boot-devtools") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 01b8bf6..99340b4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 933b647..2c2bbe5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/src/main/java/com/poprosturonin/SecurityConfig.java b/src/main/java/com/poprosturonin/SecurityConfig.java index 8f8a93e..79fdc51 100644 --- a/src/main/java/com/poprosturonin/SecurityConfig.java +++ b/src/main/java/com/poprosturonin/SecurityConfig.java @@ -1,9 +1,11 @@ package com.poprosturonin; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.firewall.StrictHttpFirewall; @Configuration @EnableWebSecurity @@ -18,4 +20,12 @@ protected void configure(HttpSecurity http) throws Exception { .and() .httpBasic(); } + + @Bean + public StrictHttpFirewall httpFirewall() { + StrictHttpFirewall firewall = new StrictHttpFirewall(); + firewall.setAllowBackSlash(true); + firewall.setAllowUrlEncodedPercent(true); + return firewall; + } }