This commit is contained in:
Redkale
2017-05-29 21:19:52 +08:00
parent 6c039dc8f4
commit 6ede9b0f31
2 changed files with 32 additions and 0 deletions

View File

@@ -48,6 +48,8 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
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 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()) {
buffer.put("Connection: close\r\n".getBytes());
}
buffer.put(serverNameBytes);
if (this.defaultAddHeaders != null) {
for (String[] headers : this.defaultAddHeaders) {
if (headers.length > 3) {

View 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;
}
}