From 42677a3174c913036d7744eb05c9d22568eb0321 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Thu, 26 May 2022 10:01:56 +0300 Subject: [PATCH] add base64url encoding for auth header --- lib/modem.js | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/modem.js b/lib/modem.js index 16f5718..fdb4561 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -8,7 +8,6 @@ var querystring = require('querystring'), debug = require('debug')('modem'), utils = require('./utils'), util = require('util'), - url = require('url'), splitca = require('split-ca'), isWin = require('os').type() === 'Windows_NT'; @@ -165,7 +164,7 @@ Modem.prototype.dial = function (options, callback) { if (options.authconfig) { optionsf.headers['X-Registry-Auth'] = options.authconfig.key || options.authconfig.base64 || - Buffer.from(JSON.stringify(options.authconfig)).toString('base64'); + Buffer.from(JSON.stringify(options.authconfig)).toString('base64').replace(/\+/g, "-").replace(/\//g, "_"); } if (options.registryconfig) { diff --git a/package.json b/package.json index be16231..1d3d074 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "docker-modem", "description": "Docker remote API network layer module.", - "version": "3.0.3", + "version": "3.0.4", "author": "Pedro Dias ", "maintainers": [ "apocas "