@@ -0,0 +1,2370 @@
+/****************************************************************************%0A * Copyright (C) 2015 ecsec GmbH.%0A * All rights reserved.%0A * Contact: ecsec GmbH (info@ecsec.de)%0A *%0A * This file is part of the Open eCard App.%0A *%0A * GNU General Public License Usage%0A * This file may be used under the terms of the GNU General Public%0A * License version 3.0 as published by the Free Software Foundation%0A * and appearing in the file LICENSE.GPL included in the packaging of%0A * this file. Please review the following information to ensure the%0A * GNU General Public License version 3.0 requirements will be met:%0A * http://www.gnu.org/copyleft/gpl.html.%0A *%0A * Other Usage%0A * Alternatively, this file may be used in accordance with the terms%0A * and conditions contained in a signed written agreement between%0A * you and ecsec GmbH.%0A *%0A ***************************************************************************/%0A%0Apackage org.openecard.control.binding.http.interceptor;%0A%0Aimport java.io.IOException;%0Aimport org.openecard.apache.http.HttpException;%0Aimport org.openecard.apache.http.HttpResponse;%0Aimport org.openecard.apache.http.HttpResponseInterceptor;%0Aimport org.openecard.apache.http.protocol.HttpContext;%0Aimport org.openecard.common.Version;%0A%0A%0A/**%0A * HttpResponseInterceptor implementation which adds the %7B@code Server%7D header to all responses sent by the HTTP Binding.%0A *%0A * @author Hans-Martin Haase%0A */%0Apublic class ServerHeaderResponseInterceptor implements HttpResponseInterceptor %7B%0A%0A    @Override%0A    public void process(HttpResponse hr, HttpContext hc) throws HttpException, IOException %7B%0A%09hr.addHeader(%22Server%22, buildServerHeaderValue());%0A    %7D%0A%0A    /**%0A     * Creates the value of the %7B@code Server%7D header according to BSI-TR-03124-1 v1.2 section 2.2.2.1.%0A     *%0A     * @return A string containing the %7B@code Server%7D header value.%0A     */%0A    public String buildServerHeaderValue() %7B%0A%09StringBuilder builder = new StringBuilder();%0A%09builder.append(Version.getName());%0A%09builder.append(%22/%22);%0A%09builder.append(Version.getVersion());%0A%09builder.append(%22 (%22);%0A%09for (String version : Version.getSpecVersions()) %7B%0A%09    builder.append(Version.getSpecName());%0A%09    builder.append(%22/%22);%0A%09    builder.append(version);%0A%09    builder.append(%22 %22);%0A%09%7D%0A%09// remove last white space%0A%09builder.deleteCharAt(builder.lastIndexOf(%22 %22));%0A%09builder.append(%22)%22);%0A%09return builder.toString();%0A    %7D%0A    %0A%7D%0A

Add HttpResponseInterceptor implementation which add the Server header to the response.