Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 68983 invoked from network); 3 Mar 2011 09:12:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 09:12:58 -0000 Received: (qmail 38432 invoked by uid 500); 3 Mar 2011 09:12:55 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 38379 invoked by uid 500); 3 Mar 2011 09:12: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 38370 invoked by uid 99); 3 Mar 2011 09:12:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 09:12:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 09:12:57 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 082D94DE92 for ; Thu, 3 Mar 2011 09:12:37 +0000 (UTC) Date: Thu, 3 Mar 2011 09:12:37 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: <1694354754.10545.1299143557030.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <213378059.197.1298743318609.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (HTTPCLIENT-1064) ExecutionContext returning HttpUriRequest with invalid URI (missing host) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001931#comment-13001931 ] Oleg Kalnichevski commented on HTTPCLIENT-1064: ----------------------------------------------- Secure connections are 'tunnelled' through HTTP proxies, so that requests transmitted over such connections look exactly the same as if they were executed directly. In fact there is no need to bother about the proxy bit at all. You can use a much simpler algorithm: (1) get the request (2) get the request URI (3) if it is relative rewrite it using the target host from the context (4) live happily ever after. Oleg > ExecutionContext returning HttpUriRequest with invalid URI (missing host) > ------------------------------------------------------------------------- > > Key: HTTPCLIENT-1064 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1064 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.1 Final > Environment: Windows 7, java 1.6.0.21 > Reporter: Ted Troccola > Labels: HttpClient > > The HttpUriRequest contains an invalid URI - host is null > public static void main(String args[]) throws ClientProtocolException, IOException > { > HttpParams httpParams = new BasicHttpParams(); > HttpClient httpclient = new DefaultHttpClient(httpParams); > HttpGet httpGet = new HttpGet("http://www.google.com/"); > HttpContext context = new BasicHttpContext(); > httpclient.execute(httpGet, context); > HttpUriRequest currentReq = (HttpUriRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST); > System.out.println("New URI host (why is it null?): " + currentReq.getURI().getHost()); > } -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org