mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
改进ContentType.get忽略空格
This commit is contained in:
@@ -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 '[':
|
||||
|
Reference in New Issue
Block a user