@upstash/qstash 0.0.5 → 0.0.6

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
@@ -63,7 +63,7 @@ export class Consumer {
63
63
  throw new SignatureError(`invalid issuer: ${p.iss}`);
64
64
  }
65
65
  if (p.sub !== req.url) {
66
- throw new SignatureError(`invalid subject: ${p.sub}`);
66
+ throw new SignatureError(`invalid subject: ${p.sub}, want: ${req.url}`);
67
67
  }
68
68
  const now = Math.floor(Date.now() / 1000);
69
69
  if (now > p.exp) {
@@ -25,6 +25,7 @@ export function verifySignature(handler, config) {
25
25
  }
26
26
  const body = (await buffer(req)).toString();
27
27
  const url = new URL(req.url, `http://${req.headers.host}`).href;
28
+ console.log({ url });
28
29
  const isValid = await consumer.verify({ signature, body, url });
29
30
  if (!isValid) {
30
31
  res.status(400);
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.5",
6
+ "version": "v0.0.6",
7
7
  "description": "Official Deno/Typescript client for qStash",
8
8
  "repository": {
9
9
  "type": "git",
@@ -90,7 +90,7 @@ class Consumer {
90
90
  throw new SignatureError(`invalid issuer: ${p.iss}`);
91
91
  }
92
92
  if (p.sub !== req.url) {
93
- throw new SignatureError(`invalid subject: ${p.sub}`);
93
+ throw new SignatureError(`invalid subject: ${p.sub}, want: ${req.url}`);
94
94
  }
95
95
  const now = Math.floor(Date.now() / 1000);
96
96
  if (now > p.exp) {
@@ -28,6 +28,7 @@ function verifySignature(handler, config) {
28
28
  }
29
29
  const body = (await (0, micro_1.buffer)(req)).toString();
30
30
  const url = new URL(req.url, `http://${req.headers.host}`).href;
31
+ console.log({ url });
31
32
  const isValid = await consumer.verify({ signature, body, url });
32
33
  if (!isValid) {
33
34
  res.status(400);