mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2025-01-03 09:32:21 +08:00
fix(FeignConfig): 复制请求头忽略content-length
This commit is contained in:
parent
4e56b18bc7
commit
d477c0bbbb
@ -52,13 +52,17 @@ public class FeignConfig {
|
||||
if (headerNames != null) {
|
||||
while (headerNames.hasMoreElements()) {
|
||||
String name = headerNames.nextElement();
|
||||
// 忽略content-length。因为在复制请求头到新请求时,原始的content-length可能不再准确。
|
||||
if (!"content-length".equalsIgnoreCase(name)) {
|
||||
String values = request.getHeader(name);
|
||||
//将请求头保存到模板中
|
||||
// 将请求头保存到模板中,除了 Content-Length
|
||||
template.header(name, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user