forked from MirrorHub/authlib-injector
nanohttpd: refactor: simplify keep-alive check
This commit is contained in:
parent
f84afc976e
commit
514f2829e2
1 changed files with 2 additions and 3 deletions
|
@ -205,9 +205,6 @@ class HTTPSession implements IHTTPSession {
|
|||
try {
|
||||
parseHeader(new BufferedReader(new InputStreamReader(readHeader(), ISO_8859_1)));
|
||||
|
||||
String connection = this.headers.get("connection");
|
||||
boolean keepAlive = "HTTP/1.1".equals(this.protocolVersion) && (connection == null || !connection.matches("(?i).*close.*"));
|
||||
|
||||
String transferEncoding = this.headers.get("transfer-encoding");
|
||||
String contentLengthStr = this.headers.get("content-length");
|
||||
if (transferEncoding != null && contentLengthStr == null) {
|
||||
|
@ -257,6 +254,8 @@ class HTTPSession implements IHTTPSession {
|
|||
;
|
||||
}
|
||||
|
||||
boolean keepAlive = "HTTP/1.1".equals(this.protocolVersion) && !"close".equals(this.headers.get("connection"));
|
||||
|
||||
if (r == null) {
|
||||
throw new ResponseException(Status.INTERNAL_ERROR, "SERVER INTERNAL ERROR: Serve() returned a null response.");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue