Skip to content

Middleware breaks binary-typed endpoints during static site generation #193

Description

@polymutex

The Astro middleware calls response.text(), which breaks for endpoints that serve binary data.

Couldn't find a way to selectively disable the middleware based on Content-Type header or file extension, so I worked around this in my own project by creating a meta-middleware that selectively applies the astro-shield middleware based on the file extension seen in the request URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions