openid-client 5.6.2 → 5.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,26 @@ const request = require('./request');
9
9
  const { keystores } = require('./weak_cache');
10
10
  const merge = require('./merge');
11
11
 
12
- const formUrlEncode = (value) => encodeURIComponent(value).replace(/%20/g, '+');
12
+ function formUrlEncode(token) {
13
+ return encodeURIComponent(token).replace(/(?:[-_.!~*'()]|%20)/g, (substring) => {
14
+ switch (substring) {
15
+ case '-':
16
+ case '_':
17
+ case '.':
18
+ case '!':
19
+ case '~':
20
+ case '*':
21
+ case "'":
22
+ case '(':
23
+ case ')':
24
+ return `%${substring.charCodeAt(0).toString(16).toUpperCase()}`;
25
+ case '%20':
26
+ return '+';
27
+ default:
28
+ throw new Error();
29
+ }
30
+ });
31
+ }
13
32
 
14
33
  async function clientAssertion(endpoint, payload) {
15
34
  let alg = this[`${endpoint}_endpoint_auth_signing_alg`];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openid-client",
3
- "version": "5.6.2",
3
+ "version": "5.6.3",
4
4
  "description": "OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs",
5
5
  "keywords": [
6
6
  "auth",