Skip to content

读取请求正文后无法使用 Astro.rewrite

RewriteWithBodyUsed:如果请求正文已被读取,则无法使用 Astro.rewrite()。如果你需要读取正文,请先克隆请求。

¥RewriteWithBodyUsed: Astro.rewrite() cannot be used if the request body has already been read. If you need to read the body, first clone the request.

¥What went wrong?

如果请求正文已被读取,则无法使用 Astro.rewrite()。如果你需要读取正文,请先克隆请求。例如:

¥Astro.rewrite() cannot be used if the request body has already been read. If you need to read the body, first clone the request. For example:

const data = await Astro.request.clone().formData();
Astro.rewrite("/target")

也可以看看:

¥See Also:

Astro 中文网 - 粤ICP备13048890号