Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-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 0F76318940 for ; Sat, 18 Jul 2015 11:54:31 +0000 (UTC) Received: (qmail 43204 invoked by uid 500); 18 Jul 2015 11:54:31 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 43170 invoked by uid 500); 18 Jul 2015 11:54:30 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 43158 invoked by uid 99); 18 Jul 2015 11:54:30 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jul 2015 11:54:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 420751A72C4 for ; Sat, 18 Jul 2015 11:54:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.209 X-Spam-Level: X-Spam-Status: No, score=-0.209 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, RCVD_IN_MSPIKE_H2=-1.108, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id kRHODXtZHKcX for ; Sat, 18 Jul 2015 11:54:29 +0000 (UTC) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 3DFC320604 for ; Sat, 18 Jul 2015 11:54:28 +0000 (UTC) Received: by iebmu5 with SMTP id mu5so92042885ieb.1 for ; Sat, 18 Jul 2015 04:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=2+TjvOHM148WSIKP5UUGy0zhL7C7/Vyhr4usWP+4mbE=; b=D3ijTXyEu7D+C+UpMaOhYzB3bVnMEHeVN6YKYMWsmobyTIHi1T3UGiO0idsgrCwQBX Sct84QUXPzfHDCnQrpr5ZEDNu64IujXkPJViB46//KEj3nNW6/pTClOBdheqn+OsNPQP C3nP3SFuuPYG9XjVI8huo3nnzf36j69uWLEM7PxT58rXJrzp/vlov7Q0cUVy2BTj6cgJ tIKF0HNnjz5IKvWLrqrclrYKQMG8PLzqn0fX6WaWC+3yT8QgSmcSe5kkexlb6l0aIo0e aQZj+bb2UkuCHyHuC5LT6S1PKNpansYZIXMR1B9e+z+5dSEoZVo/Y0WClCtzZYgP7tLb H93A== MIME-Version: 1.0 X-Received: by 10.107.19.147 with SMTP id 19mr6523998iot.170.1437220416136; Sat, 18 Jul 2015 04:53:36 -0700 (PDT) Received: by 10.107.46.32 with HTTP; Sat, 18 Jul 2015 04:53:36 -0700 (PDT) In-Reply-To: References: <20150714213134.7F9C7AC0041@hades.apache.org> Date: Sat, 18 Jul 2015 12:53:36 +0100 Message-ID: Subject: Re: svn commit: r1691090 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java From: sebb To: dev@jmeter.apache.org Content-Type: text/plain; charset=UTF-8 On 18 July 2015 at 12:42, Philippe Mouawad wrote: > Hi sebb, > My answers below. > Regards > > On Saturday, July 18, 2015, sebb wrote: > >> On 16 July 2015 at 23:26, Philippe Mouawad > > wrote: >> > On Thursday, July 16, 2015, sebb > >> wrote: >> > >> >> -1 >> >> >> >> This may break existing test plans, >> > >> > >> > Are you sure, I only updated the part that concerns embedded download. >> >> Sorry, I thought this related to fixing URLs provided in the "Path" field. >> >> However, I am still wary of changing the processing. >> If the embedded URL has incorrect syntax, then why should JMeter fix it? > > The "broken" url work correctly in browsers, you can test with my test > content. > And note currently JMeter "partially fixes" spaces > >> >> At the very least, I think JMeter should warn the user that the URL was >> invalid. >> That way there is at least a chance that it can be fixed. This is still true. If the URL is silently fixed, how is it ever going to be reported and fixed at source? >> >> > It's a real issue for some users, and should be fixed. >> >> Or the app developers should fix the URLs so that they are valid. >> >> Not always possible and I am not sure url is illegal If it's not illegal, why is it being rejected? >> > >> >> and is contrary to the >> >> component_reference documentation. >> > >> > This can be updated >> >> If the patch relates to embedded downloads then the component ref docs >> don't need to be changed. >> >> > >> >> >> >> On 14 July 2015 at 22:31, >> > wrote: >> >> > Author: pmouawad >> >> > Date: Tue Jul 14 21:31:34 2015 >> >> > New Revision: 1691090 >> >> > >> >> > URL: http://svn.apache.org/r1691090 >> >> > Log: >> >> > Bug 58137 - JMeter fails to download embedded URLS that contain >> illegal >> >> characters in URL (it does not escape them) >> >> > Bugzilla Id: 58137 >> >> > >> >> > Modified: >> >> > >> >> >> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java >> >> > >> >> > Modified: >> >> >> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java >> >> > URL: >> >> >> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1691090&r1=1691089&r2=1691090&view=diff >> >> > >> >> >> ============================================================================== >> >> > --- >> >> >> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java >> >> (original) >> >> > +++ >> >> >> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java >> >> Tue Jul 14 21:31:34 2015 >> >> > @@ -1242,7 +1242,7 @@ public abstract class HTTPSamplerBase ex >> >> > log.warn("Null URL detected (should not >> >> happen)"); >> >> > } else { >> >> > String urlstr = url.toString(); >> >> > - String urlStrEnc=encodeSpaces(urlstr); >> >> > + String >> >> urlStrEnc=escapeIllegalURLCharacters(encodeSpaces(urlstr)); >> >> > if (!urlstr.equals(urlStrEnc)){// There were >> >> some spaces in the URL >> >> > try { >> >> > url = new URL(urlStrEnc); >> >> > @@ -1352,6 +1352,23 @@ public abstract class HTTPSamplerBase ex >> >> > } >> >> > >> >> > /** >> >> > + * @param url URL to escape >> >> > + * @return escaped url >> >> > + */ >> >> > + private String escapeIllegalURLCharacters(String url) { >> >> > + try { >> >> > + String escapedUrl = >> >> ConversionUtils.escapeIllegalURLCharacters(url); >> >> > + if(log.isDebugEnabled()) { >> >> > + log.debug("Successfully escaped url:'"+url +"' >> >> to:'"+escapedUrl+"'"); >> >> > + } >> >> > + return escapedUrl; >> >> > + } catch (Exception e1) { >> >> > + log.error("Error escaping URL:'"+url+"', >> >> message:"+e1.getMessage()); >> >> > + return url; >> >> > + } >> >> > + } >> >> > + >> >> > + /** >> >> > * Extract User-Agent header value >> >> > * @param sampleResult HTTPSampleResult >> >> > * @return User Agent part >> >> > >> >> > >> >> >> > >> > >> > -- >> > Cordialement. >> > Philippe Mouawad. >> > > > -- > Cordialement. > Philippe Mouawad.