@upstash/qstash
Advanced tools
Comparing version 0.0.8 to 0.0.9
import * as dntShim from "./_dnt.shims.js"; | ||
import * as base64url from "./deps/deno.land/std@0.144.0/encoding/base64url.js"; | ||
import * as base64 from "./deps/deno.land/std@0.144.0/encoding/base64.js"; | ||
export class SignatureError extends Error { | ||
@@ -77,4 +76,4 @@ constructor(message) { | ||
const bodyHash = await dntShim.crypto.subtle.digest("SHA-256", new TextEncoder().encode(req.body)); | ||
if (p.body != base64.encode(bodyHash)) { | ||
throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64.encode(bodyHash)}`); | ||
if (p.body != base64url.encode(bodyHash)) { | ||
throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64url.encode(bodyHash)}`); | ||
} | ||
@@ -81,0 +80,0 @@ return true; |
@@ -6,3 +6,3 @@ { | ||
"name": "@upstash/qstash", | ||
"version": "v0.0.8", | ||
"version": "v0.0.9", | ||
"description": "Official Deno/Typescript client for qStash", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -29,3 +29,2 @@ "use strict"; | ||
const base64url = __importStar(require("./deps/deno.land/std@0.144.0/encoding/base64url.js")); | ||
const base64 = __importStar(require("./deps/deno.land/std@0.144.0/encoding/base64.js")); | ||
class SignatureError extends Error { | ||
@@ -105,4 +104,4 @@ constructor(message) { | ||
const bodyHash = await dntShim.crypto.subtle.digest("SHA-256", new TextEncoder().encode(req.body)); | ||
if (p.body != base64.encode(bodyHash)) { | ||
throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64.encode(bodyHash)}`); | ||
if (p.body != base64url.encode(bodyHash)) { | ||
throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64url.encode(bodyHash)}`); | ||
} | ||
@@ -109,0 +108,0 @@ return true; |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
33045
855