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).

Issue fork drimage-3444398

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Nikro created an issue. See original summary.

nikro’s picture

Assigned: nikro » Unassigned
Status: Active » Needs review

Please check of this approach fixes the issue and doesn't cause any unexpected side-effects.

dieterholvoet’s picture

Title: Drimage + StageFile Proxy + Webforms (Private) » Private files not accessible when using Drimage with Stage File Proxy

  • dieterholvoet committed 8b70c475 on 2.x authored by nikro
    Issue #3444398 by nikro, dieterholvoet: Private files not accessible...
dieterholvoet’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.