Skip to content

Commit

Permalink
Merge pull request #143 from pysarenko-bohdan/base64url-auth-fix
Browse files Browse the repository at this point in the history
add base64url encoding for auth header; patch version upgrade
  • Loading branch information
apocas authored Jun 3, 2022
2 parents 9fd71f5 + 42677a3 commit 1213d91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"maintainers": [
"apocas <[email protected]>"
Expand Down

0 comments on commit 1213d91

Please sign in to comment.