8859-1而不是utf-8的形式提交

gab6jxml  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(148)

赏金6天后到期。此问题的答案有资格获得+50声誉奖励。沙利文想引起更多的注意这个问题。

我在Grails4.0.9中使用KeyClope和Spring Security 。具有以下依赖项

compile group: 'org.keycloak', name: 'keycloak-spring-security-adapter', version: '12.0.2'
compile "org.springframework.security:spring-security-config:4.2.13.RELEASE"
compile "org.springframework.security:spring-security-web:4.2.13.RELEASE"

当我在html页面上打印时,我提交的任何带有特殊字符的表单,即ä,都将作为“ä”。post参数看起来正确。我还检查了application.yml(view/gsp/encoding=utf-8)中的grails设置。
我的securityconfig如下所示:

@Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http)
        http
            .authorizeRequests()
            .anyRequest().permitAll()
        http.csrf().disable() // disable CSRF since g:forms wouldnt work
    }

如果删除依赖项,表单提交将按预期工作。因此,我认为Spring Security 存在问题。
ps:我查过了https://github.com/spring-projects/spring-boot/issues/3912 -但问题似乎已经解决了。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题