@octokit/webhooks 6.3.1 → 6.3.2
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.
- package/package.json +1 -1
- package/sign/index.js +2 -2
- package/test/integration/verify-test.js +4 -0
package/package.json
CHANGED
package/sign/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function sign (secret, payload) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function toNormalizedJsonString (payload) {
|
|
15
|
-
return JSON.stringify(payload).replace(
|
|
16
|
-
return s.substr(0,
|
|
15
|
+
return JSON.stringify(payload).replace(/[^\\]\\u[\da-f]{4}/g, s => {
|
|
16
|
+
return s.substr(0, 3) + s.substr(3).toUpperCase()
|
|
17
17
|
})
|
|
18
18
|
}
|
|
@@ -59,6 +59,10 @@ test('verify(secret, eventPayload, signature) returns true if eventPayload conta
|
|
|
59
59
|
foo: 'Foo\n\u001B[34mbar: ♥♥♥♥♥♥♥♥\nthis-is-lost\u001B[0m\u001B[2K'
|
|
60
60
|
}, 'sha1=7316ec5e7866e42e4aba4af550d21a5f036f949d')
|
|
61
61
|
t.is(signatureMatchesUpperCaseSequence, true)
|
|
62
|
+
const signatureMatchesEscapedSequence = verify('development', {
|
|
63
|
+
foo: '\\u001b'
|
|
64
|
+
}, 'sha1=2c440a176f4cb84c8c921dfee882d594c2465097')
|
|
65
|
+
t.is(signatureMatchesEscapedSequence, true)
|
|
62
66
|
|
|
63
67
|
t.end()
|
|
64
68
|
})
|