mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
改进ContentType.get忽略空格
This commit is contained in:
@@ -132,7 +132,7 @@ public enum ContentType {
|
||||
public static ContentType get(final String body) {
|
||||
ContentType contentType = null;
|
||||
if (StrUtil.isNotBlank(body)) {
|
||||
final char firstChar = body.charAt(0);
|
||||
final char firstChar = StrUtil.trimPrefix(body).charAt(0);
|
||||
switch (firstChar) {
|
||||
case '{':
|
||||
case '[':
|
||||
|
Reference in New Issue
Block a user