mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
qol(runtime): clarify message about unavailable headers (#10583)
* qol(runtime): clarify message about unavailable headers * update test assertion
This commit is contained in:
parent
4abdb9d285
commit
bd7effcf72
2 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ export function createRequest({
|
|||
get() {
|
||||
logger.warn(
|
||||
null,
|
||||
`\`Astro.request.headers\` is not available in "static" output mode. To enable header access: set \`output: "server"\` or \`output: "hybrid"\` in your config file.`
|
||||
`\`Astro.request.headers\` is unavailable in "static" output mode, and in prerendered pages within "hybrid" and "server" output modes. If you need access to request headers, make sure that \`output\` is configured as either \`"server"\` or \`output: "hybrid"\` in your config file, and that the page accessing the headers is rendered on-demand.`
|
||||
);
|
||||
return _headers;
|
||||
},
|
||||
|
|
|
@ -186,7 +186,7 @@ describe('Static build', () => {
|
|||
it('warns when accessing headers', async () => {
|
||||
let found = false;
|
||||
for (const log of logs) {
|
||||
if (/`Astro\.request\.headers` is not available in "static" output mode/.test(log.message)) {
|
||||
if (/`Astro\.request\.headers` is unavailable in "static" output mode/.test(log.message)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue