Images not proxied when file_public_path does not match web root

Created on 8 June 2023, about 1 year ago
Updated 31 May 2024, 16 days ago

Problem/Motivation

In some scenarios, proxy images are not served.

We have observed this in a Docker-based local development environment where the files directory is on a separate volume.

So the full path as the webserver sees it is /var/www/app-files/sites/default/files

In \Drupal\stage_file_proxy\EventSubscriber\ProxySubscriber::checkFileOrigin, the value returned from $this->manager->filePublicPath() is the absolute server path.

This means that the function returns early, because the file directory is not included in the request path.

Steps to reproduce

Set up a Docker environment with the files directory served from a separate volume
Set up stage file proxy
Load a page with images from production

Proposed resolution

tbc - perhaps change \Drupal\stage_file_proxy\FetchManager::filePublicPath so that

Remaining tasks

User interface changes

n/a

API changes

n/a

Data model changes

n/a

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom malcomio

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024