HttpResponse
This commit is contained in:
@@ -1077,16 +1077,16 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
|
|||||||
&& !this.respHeadContainsConnection
|
&& !this.respHeadContainsConnection
|
||||||
&& !this.request.isWebSocket()
|
&& !this.request.isWebSocket()
|
||||||
&& (this.contentType == null
|
&& (this.contentType == null
|
||||||
|| this.contentType == this.jsonContentType
|
|| Objects.equals(this.contentType, this.jsonContentType)
|
||||||
|| this.contentType == this.plainContentType)
|
|| Objects.equals(this.contentType, this.plainContentType))
|
||||||
&& (this.contentLength >= 0 && this.contentLength < jsonLiveContentLengthArray.length)) {
|
&& (this.contentLength >= 0 && this.contentLength < jsonLiveContentLengthArray.length)) {
|
||||||
byte[][] lengthArray = this.plainLiveContentLengthArray;
|
byte[][] lengthArray = this.plainLiveContentLengthArray;
|
||||||
if (this.request.isKeepAlive()) {
|
if (this.request.isKeepAlive()) {
|
||||||
if (this.contentType == this.jsonContentType) {
|
if (Objects.equals(this.contentType, this.jsonContentType)) {
|
||||||
lengthArray = this.jsonLiveContentLengthArray;
|
lengthArray = this.jsonLiveContentLengthArray;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.contentType == this.jsonContentType) {
|
if (Objects.equals(this.contentType, this.jsonContentType)) {
|
||||||
lengthArray = this.jsonCloseContentLengthArray;
|
lengthArray = this.jsonCloseContentLengthArray;
|
||||||
} else {
|
} else {
|
||||||
lengthArray = this.plainCloseContentLengthArray;
|
lengthArray = this.plainCloseContentLengthArray;
|
||||||
@@ -1115,9 +1115,9 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.request.isWebSocket()) {
|
if (!this.request.isWebSocket()) {
|
||||||
if (this.contentType == this.jsonContentType) {
|
if (Objects.equals(this.contentType, this.jsonContentType)) {
|
||||||
headerArray.put(this.jsonContentTypeBytes);
|
headerArray.put(this.jsonContentTypeBytes);
|
||||||
} else if (this.contentType == null || this.contentType == this.plainContentType) {
|
} else if (this.contentType == null || Objects.equals(this.contentType, this.plainContentType)) {
|
||||||
headerArray.put(this.plainContentTypeBytes);
|
headerArray.put(this.plainContentTypeBytes);
|
||||||
} else {
|
} else {
|
||||||
headerArray.put(("Content-Type: " + this.contentType + "\r\n").getBytes());
|
headerArray.put(("Content-Type: " + this.contentType + "\r\n").getBytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user