This commit is contained in:
SearchNull
2021-12-29 11:11:57 +08:00
parent 620228f129
commit daa2c44f88
2 changed files with 2 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ public class HttpUtil {
// 处理请求头
if (!httpBody && line.split(":").length >= 2) {
key = line.substring(0, line.indexOf(":") - 1).trim();
key = line.substring(0, line.indexOf(":")).trim();
value = line.substring(line.indexOf(":") + 1).trim();
headers.put(key, value);
continue;

View File

@@ -24,7 +24,7 @@ public class Parser {
String key;
String value;
for (String head : header) {
key = head.substring(0, head.indexOf(":") - 1).trim();
key = head.substring(0, head.indexOf(":")).trim();
value = head.substring(head.indexOf(":") - 1).trim();
map.put(key, value);
}