From cc10917666ef725cd21559891370485423ae808c Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sat, 25 May 2019 07:57:27 +0200
Subject: [PATCH] refactor: packagist auth (#3809)

---
 lib/datasource/packagist/index.js | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/datasource/packagist/index.js b/lib/datasource/packagist/index.js
index 69007c5aa8..029e621b45 100644
--- a/lib/datasource/packagist/index.js
+++ b/lib/datasource/packagist/index.js
@@ -13,14 +13,11 @@ module.exports = {
 
 function getHostOpts(url) {
   const opts = {
-    ...hostRules.find({ hostType: 'packagist', url }),
     json: true,
   };
-  if (opts && opts.username && opts.password) {
-    const auth = Buffer.from(`${opts.username}:${opts.password}`).toString(
-      'base64'
-    );
-    opts.headers = { Authorization: `Basic ${auth}` };
+  const { username, password } = hostRules.find({ hostType: 'packagist', url });
+  if (username && password) {
+    opts.auth = `${opts.username}:${opts.password}`;
   }
   return opts;
 }
-- 
GitLab