mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
改进ContentType.get忽略空格
This commit is contained in:
parent
2e51604cb7
commit
e183d53787
@ -14,6 +14,7 @@
|
||||
* 【core 】 Opt增加ifFail(pr#1239@Gitee)
|
||||
* 【poi 】 增加GlobalPoiConfig(issue#IAEHJH@Gitee)
|
||||
* 【core 】 优化IndexedComparator性能(pr#1240@Gitee)
|
||||
* 【http 】 改进ContentType.get忽略空格(pr#3664@Github)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复因RFC3986理解有误导致的UrlPath处理冒号转义问题(issue#IAAE88@Gitee)
|
||||
|
@ -120,8 +120,7 @@ public enum ContentType {
|
||||
public static ContentType get(String body) {
|
||||
ContentType contentType = null;
|
||||
if (StrUtil.isNotBlank(body)) {
|
||||
body = StrUtil.trim(body);
|
||||
char firstChar = body.charAt(0);
|
||||
char firstChar = StrUtil.trimStart(body).charAt(0);
|
||||
switch (firstChar) {
|
||||
case '{':
|
||||
case '[':
|
||||
|
Loading…
Reference in New Issue
Block a user