Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 89901 invoked from network); 12 Dec 2007 10:46:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2007 10:46:16 -0000 Received: (qmail 22140 invoked by uid 500); 12 Dec 2007 10:46:04 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 22101 invoked by uid 500); 12 Dec 2007 10:46:04 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 22090 invoked by uid 99); 12 Dec 2007 10:46:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 02:46:04 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 10:45:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 46C861A9832; Wed, 12 Dec 2007 02:45:54 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r603548 - in /geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec: HttpIoHandler.java HttpRequestMessage.java Date: Wed, 12 Dec 2007 10:45:53 -0000 To: scm@geronimo.apache.org From: rickmcguire@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071212104554.46C861A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rickmcguire Date: Wed Dec 12 02:45:53 2007 New Revision: 603548 URL: http://svn.apache.org/viewvc?rev=603548&view=rev Log: GERONIMO-3618 when redirected via status code 30x, the original query is incorrectly appended to the location Patch submitted by Sangjin Lee. Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpIoHandler.java geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpIoHandler.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpIoHandler.java?rev=603548&r1=603547&r2=603548&view=diff ============================================================================== --- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpIoHandler.java (original) +++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpIoHandler.java Wed Dec 12 02:45:53 2007 @@ -117,8 +117,13 @@ AsyncHttpClient client = (AsyncHttpClient) ioSession.getAttachment(); //Change the request url to the redirect - String query = request.getUrl().getQuery(); request.setUrl(new URL(response.getLocation())); + // if we're redirected via 30x, the request method should be reset to GET + if (!request.getRequestMethod().equals(HttpRequestMessage.REQUEST_GET)) { + request.setRequestMethod(HttpRequestMessage.REQUEST_GET); + } + // we also need to clear out the parameters + request.clearAllParameters(); //Send the redirect client.sendRequest(request); Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java?rev=603548&r1=603547&r2=603548&view=diff ============================================================================== --- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java (original) +++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java Wed Dec 12 02:45:53 2007 @@ -360,6 +360,14 @@ public void setParameter(String name, String value) { parameters.put(name, value); } + + /** + * Clears all parameters. + * + */ + public void clearAllParameters() { + parameters.clear(); + } /** * Gets the user agent string.