mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
327b6b7dd2
commit
41e3037d4b
@ -384,7 +384,11 @@ public class Request implements HeaderOperation<Request> {
|
||||
|
||||
// 根据内容赋值默认Content-Type
|
||||
if (StrUtil.isBlank(header(HeaderName.CONTENT_TYPE))) {
|
||||
header(HeaderName.CONTENT_TYPE, body.contentType(charset()), true);
|
||||
final String contentType = body.contentType(charset());
|
||||
// 如果用户自定义的Header为null,不调用,防止实现类中可能的空指针问题
|
||||
if(null != contentType){
|
||||
header(HeaderName.CONTENT_TYPE, contentType, true);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user