From a09475d21946e2427cd9a84d09969de4d5e66cf4 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 29 Jan 2019 19:20:36 +0100
Subject: [PATCH] fix(docker): match https prefix

---
 lib/datasource/docker/index.js                    | 2 +-
 test/datasource/__snapshots__/docker.spec.js.snap | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/datasource/docker/index.js b/lib/datasource/docker/index.js
index 681c3cc71c..3db8dd174e 100644
--- a/lib/datasource/docker/index.js
+++ b/lib/datasource/docker/index.js
@@ -19,7 +19,7 @@ function massageRegistry(input, registryUrls) {
   if (!registry || registry === 'docker.io') {
     registry = 'index.docker.io';
   }
-  if (!registry.match('$https?://')) {
+  if (!registry.match('^https?://')) {
     registry = `https://${registry}`;
   }
   return registry;
diff --git a/test/datasource/__snapshots__/docker.spec.js.snap b/test/datasource/__snapshots__/docker.spec.js.snap
index 8288c34e08..f0cf969441 100644
--- a/test/datasource/__snapshots__/docker.spec.js.snap
+++ b/test/datasource/__snapshots__/docker.spec.js.snap
@@ -193,13 +193,13 @@ exports[`api/docker getPkgReleases uses custom registry 1`] = `
 [MockFunction] {
   "calls": Array [
     Array [
-      "https://https://registry.company.com/v2/",
+      "https://registry.company.com/v2/",
       Object {
         "throwHttpErrors": false,
       },
     ],
     Array [
-      "https://https://registry.company.com/v2/library/node/tags/list?n=10000",
+      "https://registry.company.com/v2/library/node/tags/list?n=10000",
       Object {
         "headers": Object {},
         "json": true,
-- 
GitLab