Comments (3)
java.lang.IllegalArgumentException: Invalid character found in the request target [/restdoc/document/80c09aafab9e3781bd05cb725a5eb84e/snippet/view?type=requestBody&field=data[]]. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:491)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:260)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
from rest-doc.
"[]"属于特殊字符,Tomcat无法解析
from rest-doc.
解决方案1
1-0 修改Tomcat配置
1-1 修改springboot配置
@Bean
public ConfigurableServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
connector.setProperty("relaxedQueryChars", "|{}[]");
}
});
return factory;
}
解决方案2
encode特殊字符
js encode
encodeURIComponent("string")
java decode
URLDecoder.decode(path, StandardCharsets.UTF_8.name())
from rest-doc.
Related Issues (20)
- 生成API文档时 附带JSON数据格式
- 1.0 preview版本开发计划步骤 HOT 10
- redis序列化问题
- mongodb4.2.0bug
- response数据json的转换会出现服务器错误
- 优化API导入过程
- restdoc.web.controller.obj.VOKt#getROOT_NAV全局变量BUG HOT 1
- console端重启后,内存中的客户端会多出一个
- 复合型应用会跟console端建立多个长连接
- ClientRegistryCenter类优化
- 如何调整API文档的所在目录
- 删除资源功能优化
- 1.0.RELEASE优化计划 HOT 2
- restdoc-client无法访问restdoc-console的容器内部
- 云上测试RPC调试API会出现超时的情况
- Java saxreader技术解析xml解析与反解析需求
- 增加对Http API响应类型的解析问题
- 项目API在API导入时ID需要将ProjectId参数加入进去,否则引起多个项目引用一个目录或者文档
- REST-doc更名为SmartDoc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest-doc.