我有@EnableZuulProxy使用的Spring Boot zuul网关
当我在url中使用not latin参数时,在网关应用程序中出现错误:
java.lang.IllegalArgumentException:在请求目标中找到无效字符。有效字符在RFC 7230和RFC 3986中定义 在> org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)〜[tomcat-embed-core-8.5.34.jar:8.5.34]
在日志跟踪中,我看到将参数从?lastName = dfg%D1%8Bsdfd转换为?lastName =dfgÑsdfd
据我了解,这是转换为iso-8859-1编码的结果。我尝试使用spring-boot-starter-undertow代替tomcat,但没有效果。
我在旧帖子中已经看到了有关此问题的讨论,但它声称该问题已在当前版本的spring-cloud中得到解决
答案 0 :(得分:0)
它是应用yml中的属性: 祖尔: forceOriginalQueryStringEncoding:正确