@upstash/qstash 2.5.3 → 2.5.4

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.
Files changed (3) hide show
  1. package/nextjs.js +4 -2
  2. package/nextjs.mjs +4 -2
  3. package/package.json +1 -1
package/nextjs.js CHANGED
@@ -75,6 +75,7 @@ function verifySignatureEdge(handler, config) {
75
75
  nextSigningKey
76
76
  });
77
77
  return async (request, nfe) => {
78
+ const requestClone = request.clone();
78
79
  const signature = request.headers.get("upstash-signature");
79
80
  if (!signature) {
80
81
  return new (0, _server.NextResponse)(new TextEncoder().encode("`Upstash-Signature` header is missing"), {
@@ -84,7 +85,7 @@ function verifySignatureEdge(handler, config) {
84
85
  if (typeof signature !== "string") {
85
86
  throw new TypeError("`Upstash-Signature` header is not a string");
86
87
  }
87
- const body = await request.text();
88
+ const body = await requestClone.text();
88
89
  const isValid = await receiver.verify({
89
90
  signature,
90
91
  body,
@@ -114,6 +115,7 @@ function verifySignatureAppRouter(handler, config) {
114
115
  nextSigningKey
115
116
  });
116
117
  return async (request) => {
118
+ const requestClone = request.clone();
117
119
  const signature = request.headers.get("upstash-signature");
118
120
  if (!signature) {
119
121
  return new (0, _server.NextResponse)(new TextEncoder().encode("`Upstash-Signature` header is missing"), {
@@ -123,7 +125,7 @@ function verifySignatureAppRouter(handler, config) {
123
125
  if (typeof signature !== "string") {
124
126
  throw new TypeError("`Upstash-Signature` header is not a string");
125
127
  }
126
- const body = await request.text();
128
+ const body = await requestClone.text();
127
129
  const isValid = await receiver.verify({
128
130
  signature,
129
131
  body,
package/nextjs.mjs CHANGED
@@ -75,6 +75,7 @@ function verifySignatureEdge(handler, config) {
75
75
  nextSigningKey
76
76
  });
77
77
  return async (request, nfe) => {
78
+ const requestClone = request.clone();
78
79
  const signature = request.headers.get("upstash-signature");
79
80
  if (!signature) {
80
81
  return new NextResponse(new TextEncoder().encode("`Upstash-Signature` header is missing"), {
@@ -84,7 +85,7 @@ function verifySignatureEdge(handler, config) {
84
85
  if (typeof signature !== "string") {
85
86
  throw new TypeError("`Upstash-Signature` header is not a string");
86
87
  }
87
- const body = await request.text();
88
+ const body = await requestClone.text();
88
89
  const isValid = await receiver.verify({
89
90
  signature,
90
91
  body,
@@ -114,6 +115,7 @@ function verifySignatureAppRouter(handler, config) {
114
115
  nextSigningKey
115
116
  });
116
117
  return async (request) => {
118
+ const requestClone = request.clone();
117
119
  const signature = request.headers.get("upstash-signature");
118
120
  if (!signature) {
119
121
  return new NextResponse(new TextEncoder().encode("`Upstash-Signature` header is missing"), {
@@ -123,7 +125,7 @@ function verifySignatureAppRouter(handler, config) {
123
125
  if (typeof signature !== "string") {
124
126
  throw new TypeError("`Upstash-Signature` header is not a string");
125
127
  }
126
- const body = await request.text();
128
+ const body = await requestClone.text();
127
129
  const isValid = await receiver.verify({
128
130
  signature,
129
131
  body,
package/package.json CHANGED
@@ -1 +1 @@
1
- {"version":"v2.5.3","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./**"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"}},"typesVersions":{"*":{"nextjs":["./nextjs.d.ts"]}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test","fmt":"prettier --write .","lint":"tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^7.0.1","@typescript-eslint/parser":"^7.0.1","bun-types":"^1.1.7","eslint":"^8","eslint-plugin-unicorn":"^51.0.1","husky":"^9.0.10","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^ 5.2.3"}}
1
+ {"version":"v2.5.4","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./**"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"}},"typesVersions":{"*":{"nextjs":["./nextjs.d.ts"]}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test","fmt":"prettier --write .","lint":"tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^7.0.1","@typescript-eslint/parser":"^7.0.1","bun-types":"^1.1.7","eslint":"^8","eslint-plugin-unicorn":"^51.0.1","husky":"^9.0.10","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^ 5.2.3"}}