Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 95218 invoked from network); 18 Oct 2007 17:50:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Oct 2007 17:50:25 -0000 Received: (qmail 86261 invoked by uid 500); 18 Oct 2007 17:35:27 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 86239 invoked by uid 500); 18 Oct 2007 17:35:27 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 86230 invoked by uid 99); 18 Oct 2007 17:35:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 10:35:27 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erik@codefaktor.de designates 62.75.252.62 as permitted sender) Received: from [62.75.252.62] (HELO mail.eatc.de) (62.75.252.62) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 17:35:30 +0000 Received: from [10.0.1.3] (p4FD2FD7B.dip.t-dialin.net [79.210.253.123]) by mail.eatc.de (Postfix) with ESMTP id F247A13C42 for ; Thu, 18 Oct 2007 19:35:07 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: <74AE2F01-485A-43B6-8A25-EECD2F8F2E1E@codefaktor.de> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: HttpComponents Project From: Erik Abele Subject: No Server header until explicitly assigning ORIGIN_SERVER to response Date: Thu, 18 Oct 2007 19:35:06 +0200 X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org While using httpcore-4.0 for a server application I came across an issue which can be easily shown by using the ElementalHttpServer example: When running the example I get no Server header: HTTP/1.1 200 OK Date: Thu, 18 Oct 2007 16:48:00 GMT Content-Length: 5599 Content-Type: text/html After applying the attached patch to ElementalHttpServer.java I get the server header: HTTP/1.1 200 OK Date: Thu, 18 Oct 2007 16:53:49 GMT Server: Jakarta-HttpComponents/1.1 Content-Length: 5599 Content-Type: text/html The problem seems to be that the params used by the instance of HttpService are not carried over to the HttpResponse object and therefore the ResponseServer interceptor doesn't add the header in question - is this intended or am I just too blind? Cheers, Erik --- ElementalHttpServer.java.orig 2007-10-05 12:04:10.000000000 +0200 +++ ElementalHttpServer.java 2007-10-18 19:32:49.000000000 +0200 @@ -104,6 +104,12 @@ final HttpResponse response, final HttpContext context) throws HttpException, IOException { + response.getParams().setParameter (CoreProtocolPNames.ORIGIN_SERVER, + request.getParams().getParameter (CoreProtocolPNames.ORIGIN_SERVER)); + + // or alternatively simply: + //response.setParams(request.getParams()); + String method = request.getRequestLine().getMethod ().toUpperCase(); if (!method.equals("GET") && !method.equals("HEAD") && ! method.equals("POST")) { throw new MethodNotSupportedException(method + " method not supported"); --------------------------------------------------------------------- To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org