改进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

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