Take non-Clean URL requests into account

Created on 29 April 2025, about 1 month ago

Problem/Motivation

When the missing file is requested via a 'non-Clean URL' β†’ e.g. /index.php/path/to/asset.jpg, it needs to:

1. Check if the file exists, skipping the need to re-download it when not necessary.
2. Stop an infinite redirect, by ensuring the redirected file path *does not* include the "script" part of the URL. See \Drupal\Core\Utility\UnroutedUrlAssembler::addOptionDefaults()

Steps to reproduce

Request the missing file via the /index.php/ prefix, it results in a loop of it redownloading the same file whether it exists or not.

Proposed resolution

Take into account whether the current request is a clean URL (\Drupal\Core\Routing\RequestHelper::isCleanUrl()) whilst processing the redirect, or always specify the default script in the routing option so the script portion is never included in the final redirect path.

Remaining tasks

Provide issue fork/patch.

πŸ“Œ Task
Status

Active

Version

3.1

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024