MISSING_AUTHORIZATION_HEADER on batch

Created on 7 April 2025, 19 days ago

Any batch like `/batch?id=xxxxxxxxx` run into HTTP AJAX error code 401MISSING_AUTHORIZATION_HEADER

We use authentication api key only for custom plugin resources, others resources in rest ui are disabled.
To reproduce, select multiple taxonomy term or user in list and delete them.

Any ideas on how to fix this?

Thanks

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France myriam_b

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

Comments & Activities

  • Issue created by @myriam_b
  • 🇫🇷France myriam_b

    It seems to appeared only on staging and prod server. Not on local.

  • 🇫🇷France myriam_b

    On the server the parameter `?_format=` is added on batch not on local

  • 🇫🇷France myriam_b
    if (strpos($request->getRequestUri(), '?_format=') !== FALSE || strpos($request->getRequestUri(), '&_format=') !== FALSE) {
       $auth = $request->headers->get('Authorization');
    
       return NULL !== $auth;
    }
    

    We adapted the code in this way to make it ok.

Production build 0.71.5 2024