From 1c00fed1196ee3fe77604caa96cf97921705917f Mon Sep 17 00:00:00 2001
From: Martin Afanasjew <martin@afanasjew.de>
Date: Thu, 2 Jun 2016 09:36:27 +0200
Subject: [PATCH] audit: check Maven Central URLs, prefer redirector (#311)

Should help with being more consistent and makes sure to suggest the
HTTPS redirector even if equally valid HTTP URLs for specific hosts or
`central.maven.org` are used.
---
 Library/Homebrew/cmd/audit.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 4a09a69c1c..6743f2a469 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -1269,6 +1269,12 @@ class ResourceAuditor
           #{u}
       EOS
     end
+
+    # Check for Maven Central urls, prefer HTTPS redirector over specific host
+    urls.each do |u|
+      next unless u =~ %r{https?://(?:central|repo\d+)\.maven\.org/maven2/(.+)$}
+      problem "#{u} should be `https://search.maven.org/remotecontent?filepath=#{$1}`"
+    end
   end
 
   def problem(text)
-- 
GitLab