Correctly proxy GET and HEAD requests instead of dying (#542)
This commit is contained in:
parent
24176c864d
commit
08632a3a07
|
@ -41,7 +41,9 @@ export const fetchBackend = (req: NextApiRequest, name: V2CloudFunction) => {
|
||||||
'Content-Type',
|
'Content-Type',
|
||||||
'Origin',
|
'Origin',
|
||||||
])
|
])
|
||||||
return fetch(url, { headers, method: req.method, body: req })
|
const hasBody = req.method != 'HEAD' && req.method != 'GET'
|
||||||
|
const opts = { headers, method: req.method, body: hasBody ? req : undefined }
|
||||||
|
return fetch(url, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const forwardResponse = async (
|
export const forwardResponse = async (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user