【问题标题】:Invalid bracket character in query parameters in Spring BootSpring Boot中查询参数中的括号字符无效
【发布时间】:2020-10-26 18:41:40
【问题描述】:

对于 URL https://example.com?price[gte]=100 我得到了异常

ava.lang.IllegalArgumentException: Invalid character found in the request target [?price[gte]=100]. The valid characters are defined in RFC 7230 and RFC 3986
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:491) ~[tomcat-embed-core-9.0.36.jar:9.0.36]

如何解决这个问题?

【问题讨论】:

标签: spring-boot spring-mvc query-parameters


【解决方案1】:

这可以在属性中配置

server:
  tomcat:
    relaxed-query-chars: "[,]"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-21
    • 2020-06-14
    • 2019-08-03
    • 2021-01-03
    • 1970-01-01
    • 2021-09-15
    • 2011-04-15
    • 2018-03-05
    相关资源
    最近更新 更多