Skip to content

Request header X-Requested-With: XMLHttpRequest missing #3472

@zeraien

Description

@zeraien

HTMX ajax requests do not include the X-Requested-With: XMLHttpRequest header property, this can have some unforeseen consequences on endpoints that serve different responses when detecting an ajax request, for example /message/1/ can return a fully rendered site while an ajax request to /message/1/ might return just the message part.

While this is just one use case, I think it just makes sense that an Ajax request should be able to be recognized as such on the server, afaik there is no way to do this without the X-Requested-With header.

I am using django-htmx, v1.2.6 which uses htmx 2.0.7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions