@upstash/qstash 0.0.8 → 0.0.9

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/esm/consumer.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as dntShim from "./_dnt.shims.js";
2
2
  import * as base64url from "./deps/deno.land/std@0.144.0/encoding/base64url.js";
3
- import * as base64 from "./deps/deno.land/std@0.144.0/encoding/base64.js";
4
3
  export class SignatureError extends Error {
5
4
  constructor(message) {
6
5
  super(message);
@@ -74,8 +73,8 @@ export class Consumer {
74
73
  throw new SignatureError("token is not yet valid");
75
74
  }
76
75
  const bodyHash = await dntShim.crypto.subtle.digest("SHA-256", new TextEncoder().encode(req.body));
77
- if (p.body != base64.encode(bodyHash)) {
78
- throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64.encode(bodyHash)}`);
76
+ if (p.body != base64url.encode(bodyHash)) {
77
+ throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64url.encode(bodyHash)}`);
79
78
  }
80
79
  return true;
81
80
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/entrypoints/nextjs.js",
4
4
  "types": "./types/entrypoints/nextjs.d.ts",
5
5
  "name": "@upstash/qstash",
6
- "version": "v0.0.8",
6
+ "version": "v0.0.9",
7
7
  "description": "Official Deno/Typescript client for qStash",
8
8
  "repository": {
9
9
  "type": "git",
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Consumer = exports.SignatureError = void 0;
27
27
  const dntShim = __importStar(require("./_dnt.shims.js"));
28
28
  const base64url = __importStar(require("./deps/deno.land/std@0.144.0/encoding/base64url.js"));
29
- const base64 = __importStar(require("./deps/deno.land/std@0.144.0/encoding/base64.js"));
30
29
  class SignatureError extends Error {
31
30
  constructor(message) {
32
31
  super(message);
@@ -101,8 +100,8 @@ class Consumer {
101
100
  throw new SignatureError("token is not yet valid");
102
101
  }
103
102
  const bodyHash = await dntShim.crypto.subtle.digest("SHA-256", new TextEncoder().encode(req.body));
104
- if (p.body != base64.encode(bodyHash)) {
105
- throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64.encode(bodyHash)}`);
103
+ if (p.body != base64url.encode(bodyHash)) {
104
+ throw new SignatureError(`body hash does not match, want: ${p.body}, got: ${base64url.encode(bodyHash)}`);
106
105
  }
107
106
  return true;
108
107
  }