Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decoding base64 string with special characters #440

Merged
merged 2 commits into from
May 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/*
**/node_modules/*
/build/*
/test/*
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"scripts": {
"start": "gulp dev",
"build": "gulp build",
"test": "mocha test/**/*.test.js",
"test": "mocha test/**/*.test.js test/setup.js",
"test:integration": "mocha-parallel-tests --max-parallel 2 integration/**/*.test.js",
"test:watch": "mocha --watch -R min test/**/*.test.js",
"ci:test": "istanbul cover _mocha --report lcovonly -R test/**/* -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-",
"test:watch": "mocha --watch -R min test/**/*.test.js test/setup.js",
"ci:test": "istanbul cover _mocha --report lcovonly -R test/**/* test/setup.js -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-",
"ci:coverage": "codecov",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src",
Expand All @@ -37,7 +37,7 @@
"license": "MIT",
"dependencies": {
"base64-js": "^1.2.0",
"idtoken-verifier": "^1.0.1",
"idtoken-verifier": "^1.0.2",
"qs": "^6.4.0",
"superagent": "^3.3.1",
"url-join": "^1.1.0",
Expand Down Expand Up @@ -95,4 +95,4 @@
"git add"
]
}
}
}
11 changes: 11 additions & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
before(function() {
function atob(str) {
return new Buffer(str, 'base64').toString('binary');
}
function btoa(str) {
return Buffer.from(str, 'binary').toString('base64');
}
var windowOrGlobal = typeof window !== 'undefined' ? window : global;
windowOrGlobal.atob = atob;
windowOrGlobal.btoa = btoa;
});
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1942,9 +1942,9 @@ husky@^0.13.3:
is-ci "^1.0.9"
normalize-path "^1.0.0"

idtoken-verifier@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/idtoken-verifier/-/idtoken-verifier-1.0.1.tgz#7563af238dfbc5aa2995744c37bf01dea3ad08ab"
idtoken-verifier@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/idtoken-verifier/-/idtoken-verifier-1.0.2.tgz#7457d8b3d13e59ca3ab085ed43d2b43e48536f1d"
dependencies:
base64-js "^1.2.0"
crypto-js "^3.1.9-1"
Expand Down