Skip to content

Commit

Permalink
fix: actually remove the base64url proper encoding check
Browse files Browse the repository at this point in the history
This should've landed with 470b4c7
  • Loading branch information
panva committed Feb 3, 2020
1 parent dec5d23 commit eae01b5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/help/base64url.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
const { JOSEInvalidEncoding } = require('../errors')

const b64uRegExp = /^[a-zA-Z0-9_-]*$/

const fromBase64 = (base64) => {
return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_')
}
Expand All @@ -15,10 +11,6 @@ const encodeBuffer = (buf) => {
}

const decodeToBuffer = (input) => {
if (!b64uRegExp.test(input)) {
throw new JOSEInvalidEncoding('input is not a valid base64url encoded string')
}

return Buffer.from(input, 'base64')
}

Expand Down

0 comments on commit eae01b5

Please sign in to comment.