Use the correct way to determine if a request is an ajax request

Created on 19 September 2023, about 1 year ago

Problem/Motivation

I just stumbled upon the comment in ForcePasswordChangeEventSubscriber that mentions the current method of sniffing header 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.71.5 2024