改进ContentType.get忽略空格

This commit is contained in:
Looly 2024-07-31 00:23:53 +08:00
parent 2e51604cb7
commit e183d53787
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,7 @@
* 【core 】 Opt增加ifFailpr#1239@Gitee
* 【poi 】 增加GlobalPoiConfigissue#IAEHJH@Gitee
* 【core 】 优化IndexedComparator性能pr#1240@Gitee
* 【http 】 改进ContentType.get忽略空格pr#3664@Github
### 🐞Bug修复
* 【core 】 修复因RFC3986理解有误导致的UrlPath处理冒号转义问题issue#IAAE88@Gitee

View File

@ -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 '[':