Skip to content

Custom 500 page content-type is text/plain;charset=UTF-8 #7992

@minht11

Description

@minht11

What version of astro are you using?

2.10.3

Are you using an SSR adapter? If so, which one?

Node

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome, Firefox, Safari

Describe the Bug

Have a page which returns 500 response.
Here is how behaviors differ:

  • in dev mode it will show body of the 500 response.
  • in build mode it will display actual custom 500 page, but its content-type header will be text/plain;charset=UTF-8
Screenshot 2023-08-08 at 12 04 19

What's the expected result?

Behavior of 500 response is consistent between modes, and content-type is returned correcly.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-pt4enm-mla9j5

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)feat: error pagesRelated to 404 and 500 handling (scope)feat: ssrRelated to SSR (scope)pkg: nodeRelated to Node adapter (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions