Skip to content
1 change: 1 addition & 0 deletions src/content/docs/zh-cn/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
- [**MiddlewareNoDataOrNextCalled**](/zh-cn/reference/errors/middleware-no-data-or-next-called/)<br/>The middleware didn't return a `Response`.
- [**MiddlewareNotAResponse**](/zh-cn/reference/errors/middleware-not-aresponse/)<br/>The middleware returned something that is not a `Response` object.
- [**LocalsNotAnObject**](/zh-cn/reference/errors/locals-not-an-object/)<br/>Value assigned to `locals` is not accepted.
- [**AstroResponseHeadersReassigned**](/zh-cn/reference/errors/astro-response-headers-reassigned/)<br/>`Astro.response.headers` must not be reassigned.
- [**MiddlewareCantBeLoaded**](/zh-cn/reference/errors/middleware-cant-be-loaded/)<br/>Can't load the middleware.
- [**LocalImageUsedWrongly**](/zh-cn/reference/errors/local-image-used-wrongly/)<br/>Local images must be imported.
- [**AstroGlobUsedOutside**](/zh-cn/reference/errors/astro-glob-used-outside/)<br/>Astro.glob() used outside of an Astro file.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Astro.response.headers must not be reassigned.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **AstroResponseHeadersReassigned**: 可以向 `Astro.response.headers` 添加或删除单个头部,但不得将其整体替换为另一个 `Headers` 实例。

## 哪里出了问题?
当尝试将一个值设置为可用于 `Astro.response` 的 `ResponseInit` 对象上的 `headers` 字段时抛出此错误。