Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32C49D166 for ; Tue, 12 Feb 2013 12:18:49 +0000 (UTC) Received: (qmail 69911 invoked by uid 500); 12 Feb 2013 12:18:48 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 69861 invoked by uid 500); 12 Feb 2013 12:18:48 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 69847 invoked by uid 99); 12 Feb 2013 12:18:48 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 12:18:48 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 445721C6FF5; Tue, 12 Feb 2013 12:18:41 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2344766908851890872==" MIME-Version: 1.0 Subject: Re: Review Request: [EC2 Query API] Permission denied exception when a parameter value contains space From: "Likitha Shetty" To: "Prachi Damle" Cc: "cloudstack" , "Likitha Shetty" Date: Tue, 12 Feb 2013 12:18:41 -0000 Message-ID: <20130212121841.9635.36236@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Likitha Shetty" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/9230/ X-Sender: "Likitha Shetty" References: <20130201061030.24984.65409@reviews.apache.org> In-Reply-To: <20130201061030.24984.65409@reviews.apache.org> Reply-To: "Likitha Shetty" --===============2344766908851890872== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9230/ ----------------------------------------------------------- (Updated Feb. 12, 2013, 12:18 p.m.) Review request for cloudstack and Prachi Damle. Changes ------- Thanks for the review Prachi. I made the translation from %7E to ~ because according to rfc3986#section-2= .4(http://tools.ietf.org/html/rfc3986#section-2.4), older URI processing im= plementations encode tilde ("~") character to "%7E". But when i used the Bo= to client i see that "~" is not encoded and there is no signature mismatch = and so we don't have to replace the character after URL encoding. I have no= w updated the diff to remove 'replace ~ by %7E'. Manual testing 1. Make any EC2 Query API call with a space in the parameter value - the ap= i call should be successfully executed and throw an error = 2. Repeat the same for chararcter "*" When tested without the patch both steps throw a Permission denied exception Also note, 1. "*" is urlencoded to "*" but percent encoded to %2A 2. "space" is urlencode to "+" but percent encoded to %20 Description ------- Convert space characters in the parameters to %20 while forming a query str= ing after url-encode because java.net.URLEncoder performs application/x-www= -form-urlencoded-type encoding and not percent-encoding. According to RFC 3= 986 as required by Amazon, we need to percent-encode. This addresses bug CLOUDSTACK-1125. Diffs (updated) ----- awsapi/src/com/cloud/bridge/service/EC2RestServlet.java 5d151ba = Diff: https://reviews.apache.org/r/9230/diff/ Testing ------- Make any EC2 Query API call with a space in the parameter value - the api c= all should be successfully executed and throw an error = Thanks, Likitha Shetty --===============2344766908851890872==--