Astro hybrid output response headers #8739
Closed
friedemannsommer
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This is expected for prerendered routes. For anything that is pre-rendered Astro behaves essentially as a static site generator: it creates static HTML, CSS, etc. Deciding on MIME type headers etc. should then be done by whatever server ends up serving these static files. Usually this is done using a file extension — for example if you rename your example file to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it the expected behavior of Astro's hybrid output to ignore the headers set in the
Response
object?Suppose the following page exists:
My assumption would be that Astro would create a file containing the actual response body
and either separately or as part of the response body store the associated headers.
In the generated output a file containing the "Hello World!" string exists in the client directory,
but when requesting the route via an HTTP client, it doesn't send the associated
content-type
header.Astro manifest
This is a simplified and stripped down example containing only the "prerender" route:
I have created a StackBlitz example that includes the relevant settings and files.
Please run the following commands in order (top to bottom):
npm run build
npm run preview
<preview URL>/prerender
with any HTTP clientcontent-type: text/plain; charset=utf-8
header in the responseBeta Was this translation helpful? Give feedback.
All reactions