tokuhirom's blog

webflux で x-forwarded-for とかをケアする

以下の様にすれば良いっぽい。

https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-forwarded-headers

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.reactive.config.WebFluxConfigurer
import org.springframework.web.server.adapter.ForwardedHeaderTransformer


@Configuration
class WebConfiguration : WebFluxConfigurer {
    @Bean
    fun forwardedHeaderTransformer(): ForwardedHeaderTransformer {
        return ForwardedHeaderTransformer()
    }
}
Created: 2018-11-20 20:46:18 +0900
Updated: 2018-11-20 20:46:18 +0900