was服务器修改open files,解决feign实现微服务间的文件上传出现错误the request was rejected because no multipart boundary was ...

项目最开始的依赖

io.github.openfeign.form

feign-form

3.0.3

io.github.openfeign.form

feign-form-spring

3.0.3

commons-fileupload

commons-fileupload

1.3.3

跟踪源码发现content-type会被","或";"进行转换为Map,跟踪代码为org.apache.tomcat.util.http.fileupload.FileUploadBase#getBoundary

截图

3ecbc0062411

20191217012606545.png

在org.apache.tomcat.util.http.fileupload.FileUploadBase.FileItemIteratorImpl#FileItemIteratorImpl抛出异常

3ecbc0062411

2019121701274175.png

请求头中内容为

//用户所调用的接口提交的content-type

multipart/form-data; boundary=--------------------------381278542566024683689443

//经过feign转发请求后的content-type,按英文逗号拆分刚好Map没有boundary为key的值,索引报错

multipart/form-data, multipart/form-data; charset=UTF-8; boundary=16f0f6d2c45

解决方法为修改feign-form的版本

io.github.openfeign.form

feign-form-spring

3.6.0

io.github.openfeign.form

feign-form

3.6.0

commons-fileupload

commons-fileupload

1.3.3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值