From c36aec5d58218fb3adfb86cb2b772132f96c6015 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 24 May 2022 11:30:51 -0700 Subject: [PATCH 1/2] Document why the link needs to be unescaped Since this link will always work on GitHub regardless of whether escaped or not, I added an inline code comment with the commit message from 62366e46fea1b0c9e56d55a9aca8b1bbeb86b43b. That way someone doesn't accidentally pull this out and think they're okay just because everything continues to work on GitHub. --- nuget/lib/dependabot/nuget/update_checker/version_finder.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nuget/lib/dependabot/nuget/update_checker/version_finder.rb b/nuget/lib/dependabot/nuget/update_checker/version_finder.rb index d2b94ecb237..6d55f263e1b 100644 --- a/nuget/lib/dependabot/nuget/update_checker/version_finder.rb +++ b/nuget/lib/dependabot/nuget/update_checker/version_finder.rb @@ -232,6 +232,9 @@ def fetch_paginated_v2_nuget_listings(url_details, results = {}) if (link_href = fetch_v2_next_link_href(response.body)) url_details = url_details.dup + # Some Nuget repositories, such as JFrog's Artifactory, URL encode the "next" href + # link in the paged results. If the href is not URL decoded, the paging parameters + # are ignored and the first page is always returned. url_details[:versions_url] = CGI.unescape(link_href) fetch_paginated_v2_nuget_listings(url_details, results) end From 3a66a7245f3000952c3fd1fc2464441badca2c42 Mon Sep 17 00:00:00 2001 From: Nish Sinha Date: Tue, 24 May 2022 15:56:20 -0400 Subject: [PATCH 2/2] Rubocop fix trailing whitespace --- nuget/lib/dependabot/nuget/update_checker/version_finder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget/lib/dependabot/nuget/update_checker/version_finder.rb b/nuget/lib/dependabot/nuget/update_checker/version_finder.rb index 6d55f263e1b..c41e557502f 100644 --- a/nuget/lib/dependabot/nuget/update_checker/version_finder.rb +++ b/nuget/lib/dependabot/nuget/update_checker/version_finder.rb @@ -234,7 +234,7 @@ def fetch_paginated_v2_nuget_listings(url_details, results = {}) url_details = url_details.dup # Some Nuget repositories, such as JFrog's Artifactory, URL encode the "next" href # link in the paged results. If the href is not URL decoded, the paging parameters - # are ignored and the first page is always returned. + # are ignored and the first page is always returned. url_details[:versions_url] = CGI.unescape(link_href) fetch_paginated_v2_nuget_listings(url_details, results) end