Skip to content

Instantly share code, notes, and snippets.

@russelldavis
Created February 14, 2024 20:37
Show Gist options
  • Save russelldavis/6b1a1bf15898655ec18037bd737d075d to your computer and use it in GitHub Desktop.
Save russelldavis/6b1a1bf15898655ec18037bd737d075d to your computer and use it in GitHub Desktop.
diff --git a/templates/pages-template-plugin.ts b/templates/pages-template-plugin.ts
index 3b99ea2a82d18d3cbbe713af437dc53c33bd1273..971714e99d2d162fe525d7cab7c6ddf42b1bba1d 100644
--- a/templates/pages-template-plugin.ts
+++ b/templates/pages-template-plugin.ts
@@ -146,7 +146,7 @@ export default function (pluginArgs: unknown) {
if (result.done === false) {
const { handler, params, path } = result.value;
const context = {
- request: new Request(request.clone()),
+ request: request,
functionPath: workerContext.functionPath + path,
next: pluginNext,
params,
diff --git a/templates/pages-template-worker.ts b/templates/pages-template-worker.ts
index 67e6cee9ac7cbac5bf88f8dc75f70be3a010c4fb..31b0527e1e16e05db19c0702735a9fa923bd2e92 100644
--- a/templates/pages-template-worker.ts
+++ b/templates/pages-template-worker.ts
@@ -137,7 +137,7 @@ export default {
if (result.done === false) {
const { handler, params, path } = result.value;
const context = {
- request: new Request(request.clone()),
+ request,
functionPath: path,
next,
params,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment