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 E13CB44B6 for ; Tue, 17 May 2011 10:36:30 +0000 (UTC) Received: (qmail 33308 invoked by uid 500); 17 May 2011 10:36:30 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 33164 invoked by uid 500); 17 May 2011 10:36:30 -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 32866 invoked by uid 99); 17 May 2011 10:36:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 10:36:30 +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; Tue, 17 May 2011 10:36:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 87DE6CD759 for ; Tue, 17 May 2011 10:35:47 +0000 (UTC) Date: Tue, 17 May 2011 10:35:47 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: <2100721458.18749.1305628547553.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <627738875.10804.1305310547379.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HTTPCLIENT-1089) HTTP Client does not handle 302 redirect in POST request MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034690#comment-13034690 ] Oleg Kalnichevski commented on HTTPCLIENT-1089: ----------------------------------------------- File committed to SVN trunk as LaxRedirectStrategy [1]. Many thanks for this contribution, Bartosz. Some test coverage for it would be great, though. [1] http://svn.apache.org/viewvc?rev=1104115&view=rev > HTTP Client does not handle 302 redirect in POST request > -------------------------------------------------------- > > Key: HTTPCLIENT-1089 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1089 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.1.1 > Environment: * > Reporter: Bartosz Firyn > Labels: redirect > Attachments: BrowserRedirectStrategy.java > > Original Estimate: 1h > Remaining Estimate: 1h > > POST requests are not being automatically redirected after receiving 302 response. > This is because there is a statement in the DefaultRedirectStrategy class: > 82: case HttpStatus.SC_MOVED_TEMPORARILY: > 83: return (method.equalsIgnoreCase(HttpGet.METHOD_NAME) > 84: || method.equalsIgnoreCase(HttpHead.METHOD_NAME)) && locationHeader != null; > Which means that only HEAD and GET requests are being redirected. In my opinion all requests should be redirected, not only these two types. > This should be: > 82: case HttpStatus.SC_MOVED_TEMPORARILY: > 83: return locationHeader != null; > After receiving 302 status for POST request new GET request should be send to Location URI. Internet browsers works in the same way. > Best Regards > Bartosz Firyn -- 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