Skip to content

Commit

Permalink
Move to newer Spring and Gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0gramista committed Apr 4, 2018
1 parent 018c607 commit b53c75c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
16 changes: 10 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -22,6 +25,7 @@ jar {

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/libs-snapshot' }
}

sourceCompatibility = 1.8
Expand All @@ -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")
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions src/main/java/com/poprosturonin/SecurityConfig.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
}
}

0 comments on commit b53c75c

Please sign in to comment.