mirror of
https://github.com/unmojang/authlib-injector.git
synced 2025-09-30 06:40:47 -04:00
nanohttpd: refactor: simplify keep-alive check
This commit is contained in:
parent
f84afc976e
commit
514f2829e2
@ -205,9 +205,6 @@ class HTTPSession implements IHTTPSession {
|
|||||||
try {
|
try {
|
||||||
parseHeader(new BufferedReader(new InputStreamReader(readHeader(), ISO_8859_1)));
|
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 transferEncoding = this.headers.get("transfer-encoding");
|
||||||
String contentLengthStr = this.headers.get("content-length");
|
String contentLengthStr = this.headers.get("content-length");
|
||||||
if (transferEncoding != null && contentLengthStr == null) {
|
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) {
|
if (r == null) {
|
||||||
throw new ResponseException(Status.INTERNAL_ERROR, "SERVER INTERNAL ERROR: Serve() returned a null response.");
|
throw new ResponseException(Status.INTERNAL_ERROR, "SERVER INTERNAL ERROR: Serve() returned a null response.");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user