Problem/Motivation
When Drimage is used with Stage File Proxy (which is enabled, but has no configurations aka is not in use), and user (even UID 1) tries to download a private file (submitted by Webform, not sure if it extends to other files) - it results in page not found.
Steps to reproduce
Have stage file proxy enabled, drimage enabled, a webform with private files upload. Submit the webform, and then, using UID 1 try to view uploaded private files.
Proposed resolution
It seems that this piece of code, alters the original $event object.
public function checkFileOrigin(RequestEvent $event): void {
// Process to request uri, mainly to filter out language prefixes.
$request_uri = $this->pathProcessorManager->processInbound(
$event->getRequest()->getRequestUri(),
$event->getRequest()
);
I propose to send a clone of the request, not the request itself (as we just want to compare the URI paths anyway).