Skip to content

data-include might insert the 404 error page #5360

Description

@xfq

Description of problem

URL to affected spec or repo:

What happened (e.g., it crashed)?:

data-include.js reads response.text() directly without checking response.ok. If the remote file is unavailable, a server error page might be injected into the document body.

Expected behavior (e.g., it shouldn't crash):

Check the status code before reading the body, maybe include the URL, HTTP status, and troubleshooting tips in the error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions