From notifications-return-29838-archive-asf-public=cust-asf.ponee.io@ant.apache.org Tue Jan 30 15:07:14 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 9163318061A for ; Tue, 30 Jan 2018 15:07:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8131A160C53; Tue, 30 Jan 2018 14:07:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CA235160C42 for ; Tue, 30 Jan 2018 15:07:13 +0100 (CET) Received: (qmail 17232 invoked by uid 500); 30 Jan 2018 14:07:13 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 17223 invoked by uid 99); 30 Jan 2018 14:07:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2018 14:07:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D1851E0A04; Tue, 30 Jan 2018 14:07:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gintas@apache.org To: notifications@ant.apache.org Message-Id: <52c5aba2cad1404094cb4c24eb9e33c8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ant-ivy git commit: IVY-1573 do not skip versions with URL encoded characters Date: Tue, 30 Jan 2018 14:07:12 +0000 (UTC) Repository: ant-ivy Updated Branches: refs/heads/master 18b4d2402 -> 68e0a9c71 IVY-1573 do not skip versions with URL encoded characters Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/68e0a9c7 Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/68e0a9c7 Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/68e0a9c7 Branch: refs/heads/master Commit: 68e0a9c71443738b1842e99925d37bf545f5a151 Parents: 18b4d24 Author: Gintas Grigelionis Authored: Tue Jan 30 15:05:24 2018 +0100 Committer: Gintas Grigelionis Committed: Tue Jan 30 15:06:58 2018 +0100 ---------------------------------------------------------------------- .../org/apache/ivy/util/url/ApacheURLLister.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/68e0a9c7/src/java/org/apache/ivy/util/url/ApacheURLLister.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/util/url/ApacheURLLister.java b/src/java/org/apache/ivy/util/url/ApacheURLLister.java index fed36bb..c275e09 100644 --- a/src/java/org/apache/ivy/util/url/ApacheURLLister.java +++ b/src/java/org/apache/ivy/util/url/ApacheURLLister.java @@ -21,6 +21,8 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -140,19 +142,21 @@ public class ApacheURLLister { text = text.trim(); - // handle complete URL listings - if (href.startsWith("http:") || href.startsWith("https:")) { - try { - href = new URL(href).getPath(); + try { + // URI methods decode the URL + URI uri = new URI(href); + href = uri.getPath(); + // handle complete URL listings + if (uri.getScheme() != null) { if (!href.startsWith(url.getPath())) { // ignore URLs which aren't children of the base URL continue; } href = href.substring(url.getPath().length()); - } catch (Exception ignore) { - // incorrect URL, ignore - continue; } + } catch (URISyntaxException e) { + // incorrect URL, ignore + continue; } if (href.startsWith("../")) {