admin管理员组文章数量:1608851
解决springboot项目请求出现非法字符问题 java.lang.IllegalArgumentException:
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
原因:上传文件名含中文,返回远程路径地址中带有中文,在使用XWPFTTempl等插件时获取文件时报错,需要转码才能使用。
可以使用hutool工具里面的---URLUtil.encode("url");
该方法只对文件名称进行编码,文件名前面的路径保持不变。
http://.../profile/upload/2023/04/10/张三.jpeg
==》http://.../profile/upload/2023/04/10/%5cxe5bca0%5cxe4b889.jpeg
本文标签: requestparsingoccurrenceshttpDebug
版权声明:本文标题:further occurrences of HTTP request parsing errors will be logged at DEBUG level。 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1728547420a1163042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论