mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(nitro): do not modify event.request
for worker entries (#1279)
This commit is contained in:
parent
7df4590d77
commit
ffb05fc734
@ -17,9 +17,9 @@ async function handleEvent (event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const url = new URL(event.request.url)
|
const url = new URL(event.request.url)
|
||||||
|
let body
|
||||||
if (requestHasBody(event.request)) {
|
if (requestHasBody(event.request)) {
|
||||||
event.request.body = await useRequestBody(event.request)
|
body = await useRequestBody(event.request)
|
||||||
}
|
}
|
||||||
|
|
||||||
const r = await localCall({
|
const r = await localCall({
|
||||||
@ -30,7 +30,7 @@ async function handleEvent (event) {
|
|||||||
headers: event.request.headers,
|
headers: event.request.headers,
|
||||||
method: event.request.method,
|
method: event.request.method,
|
||||||
redirect: event.request.redirect,
|
redirect: event.request.redirect,
|
||||||
body: event.request.body
|
body
|
||||||
})
|
})
|
||||||
|
|
||||||
return new Response(r.body, {
|
return new Response(r.body, {
|
||||||
|
@ -16,8 +16,9 @@ addEventListener('fetch', (event: any) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function handleEvent (url, event) {
|
async function handleEvent (url, event) {
|
||||||
|
let body
|
||||||
if (requestHasBody(event.request)) {
|
if (requestHasBody(event.request)) {
|
||||||
event.request.body = await useRequestBody(event.request)
|
body = await useRequestBody(event.request)
|
||||||
}
|
}
|
||||||
|
|
||||||
const r = await localCall({
|
const r = await localCall({
|
||||||
@ -28,7 +29,7 @@ async function handleEvent (url, event) {
|
|||||||
headers: event.request.headers,
|
headers: event.request.headers,
|
||||||
method: event.request.method,
|
method: event.request.method,
|
||||||
redirect: event.request.redirect,
|
redirect: event.request.redirect,
|
||||||
body: event.request.body
|
body
|
||||||
})
|
})
|
||||||
|
|
||||||
return new Response(r.body, {
|
return new Response(r.body, {
|
||||||
|
Loading…
Reference in New Issue
Block a user