Skip to content

Commit

Permalink
feat: spring 3.3.5 + configuration du firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasBousselin committed Nov 5, 2024
1 parent ba4eb6f commit d867d39
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
`kotlin-dsl`
// only apply the plugin in the subprojects requiring it because it expects a Spring Boot app
// and the shared lib is obviously not one
id("org.springframework.boot") version "3.3.4" apply false
id("org.springframework.boot") version "3.3.5" apply false
id("io.spring.dependency-management") version "1.1.6" apply false
id("org.graalvm.buildtools.native") version "0.10.3"
kotlin("jvm") version "2.0.21" apply false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.egm.stellio.shared.config

import org.springframework.beans.BeansException
import org.springframework.beans.factory.config.BeanPostProcessor
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.security.web.server.WebFilterChainProxy
import org.springframework.security.web.server.firewall.StrictServerWebExchangeFirewall

@Configuration
class FirewallConfig {

@Bean
fun beanPostProcessor(): BeanPostProcessor {
return object : BeanPostProcessor {
@Throws(BeansException::class)
override fun postProcessBeforeInitialization(bean: Any, beanName: String): Any {
if (bean is WebFilterChainProxy) {
val firewall = StrictServerWebExchangeFirewall()
firewall.setAllowUrlEncodedSlash(true)
firewall.setAllowUrlEncodedDoubleSlash(true)
firewall.setAllowSemicolon(true)
bean.setFirewall(firewall)
}
return bean
}
}
}
}

0 comments on commit d867d39

Please sign in to comment.