diff --git a/lib/datasource/packagist/index.js b/lib/datasource/packagist/index.js index 69007c5aa82f78fee68d69789e2cda8f55291f00..029e621b4572d4e3c891a62d8c1984c8dba4e8db 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; }