This commit is contained in:
@@ -48,6 +48,8 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
|
|||||||
|
|
||||||
protected static final byte[] LINE = new byte[]{'\r', '\n'};
|
protected static final byte[] LINE = new byte[]{'\r', '\n'};
|
||||||
|
|
||||||
|
protected static final byte[] serverNameBytes = ("Server: redkale/" + Redkale.getDotedVersion() + "\r\n").getBytes();
|
||||||
|
|
||||||
private static final Set<OpenOption> options = new HashSet<>();
|
private static final Set<OpenOption> options = new HashSet<>();
|
||||||
|
|
||||||
private static final DateFormat GMT_DATE_FORMAT = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
|
private static final DateFormat GMT_DATE_FORMAT = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
|
||||||
@@ -758,6 +760,8 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
|
|||||||
if (!this.request.isKeepAlive()) {
|
if (!this.request.isKeepAlive()) {
|
||||||
buffer.put("Connection: close\r\n".getBytes());
|
buffer.put("Connection: close\r\n".getBytes());
|
||||||
}
|
}
|
||||||
|
buffer.put(serverNameBytes);
|
||||||
|
|
||||||
if (this.defaultAddHeaders != null) {
|
if (this.defaultAddHeaders != null) {
|
||||||
for (String[] headers : this.defaultAddHeaders) {
|
for (String[] headers : this.defaultAddHeaders) {
|
||||||
if (headers.length > 3) {
|
if (headers.length > 3) {
|
||||||
|
|||||||
28
src/org/redkale/util/Redkale.java
Normal file
28
src/org/redkale/util/Redkale.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.redkale.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zhangjx
|
||||||
|
*/
|
||||||
|
public final class Redkale {
|
||||||
|
|
||||||
|
private Redkale() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDotedVersion() {
|
||||||
|
return "1.8.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getMajorVersion() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getMinorVersion() {
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user