Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BB4D1146C for ; Wed, 6 Aug 2014 05:09:56 +0000 (UTC) Received: (qmail 65911 invoked by uid 500); 6 Aug 2014 05:09:55 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 65871 invoked by uid 500); 6 Aug 2014 05:09:55 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 65859 invoked by uid 99); 6 Aug 2014 05:09:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Aug 2014 05:09:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 35BD188A11C; Wed, 6 Aug 2014 05:09:55 +0000 (UTC) From: pbkwee To: dev@hc.apache.org Reply-To: dev@hc.apache.org Message-ID: Subject: [GitHub] httpcore pull request: The HttpHost InetAddress constructor will u... Content-Type: text/plain Date: Wed, 6 Aug 2014 05:09:55 +0000 (UTC) GitHub user pbkwee opened a pull request: https://github.com/apache/httpcore/pull/1 The HttpHost InetAddress constructor will use the InetAddress#getHostNam... ...e (rather than InetAddress#getHostAddress) when provided with an InetAddress. System.out.println(new HttpHost(InetAddress.getByAddress("127.0.0.1", new byte[] {127,0,0,1}), 80, "http")); System.out.println(new HttpHost(InetAddress.getByAddress(new byte[] {127,0,0,1}), 80, "http")); System.out.println(new HttpHost(InetAddress.getByAddress("somehost", new byte[] {127,0,0,1}), 80, "http")); Produces: http://127.0.0.1:80 http://localhost:80 http://somehost:80 This ensures that HttpHost#getHostName reflects the name wish to use (rather than the IP address). Which can be important, for example with Cookie domains and HTTP Host: headers. You can merge this pull request into a Git repository by running: $ git pull https://github.com/pbkwee/httpcore 4.3.x Alternatively you can review and apply these changes as the patch at: https://github.com/apache/httpcore/pull/1.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1 ---- commit 696baadb8b03428f9e12f24225ecd0ae45118788 Author: peter@rimuhosting.com Date: 2014-08-06T04:55:59Z The HttpHost InetAddress constructor will use the InetAddress#getHostName (rather than InetAddress#getHostAddress) when provided with an InetAddress. System.out.println(new HttpHost(InetAddress.getByAddress("127.0.0.1", new byte[] {127,0,0,1}), 80, "http")); System.out.println(new HttpHost(InetAddress.getByAddress(new byte[] {127,0,0,1}), 80, "http")); System.out.println(new HttpHost(InetAddress.getByAddress("somehost", new byte[] {127,0,0,1}), 80, "http")); Produces: http://127.0.0.1:80 http://localhost:80 http://somehost:80 This ensures that HttpHost#getHostName reflects the name wish to use (rather than the IP address). Which can be important, for example with Cookie domains and HTTP Host: headers. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org