This commit is contained in:
Redkale
2018-03-12 20:54:24 +08:00
parent 204e6ec99f
commit 3a13d242f6

View File

@@ -134,12 +134,15 @@ public class HttpRequest extends Request<HttpContext> {
String value = array.toString(index, array.size() - index, charset).trim(); String value = array.toString(index, array.size() - index, charset).trim();
switch (name) { switch (name) {
case "Content-Type": case "Content-Type":
case "content-type":
this.contentType = value; this.contentType = value;
break; break;
case "Content-Length": case "Content-Length":
case "content-length":
this.contentLength = Long.decode(value); this.contentLength = Long.decode(value);
break; break;
case "Host": case "Host":
case "host":
this.host = value; this.host = value;
break; break;
case "Cookie": case "Cookie":
@@ -151,9 +154,13 @@ public class HttpRequest extends Request<HttpContext> {
} }
break; break;
case "Connection": case "Connection":
case "connection":
this.connection = value; this.connection = value;
this.setKeepAlive(!"close".equalsIgnoreCase(value)); this.setKeepAlive(!"close".equalsIgnoreCase(value));
break; break;
case "user-agent":
header.addValue("User-Agent", value);
break;
default: default:
header.addValue(name, value); header.addValue(name, value);
} }