Improve the way to determine if a request is an ajax request

Created on 19 September 2023, 9 months ago
Updated 22 September 2023, 9 months ago

Problem/Motivation

I just stumbled upon the comment in ForcePasswordChangeEventSubscriber that mentions the current method of header sniffing to determine if a request is an ajax request being imperfect.

Also in https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21EventSubs... one can find the implementation core uses for detecting if a request is an ajax request.

Since it's a simple change let's improve this here.

Steps to reproduce

Not applicable.

Proposed resolution

Use the same technique as core does.

Remaining tasks

Create a merge request with the changes.

User interface changes

None.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria dawitti

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024