Different root paths for file_path in File- and StyleDownloadController

Created on 3 December 2023, 10 months ago

Problem/Motivation

When I look up the x-sendfile header generated in the XsendfileFileDownloadController.php, the root path is the path of the Drupal-Installation: x-sendfile: /../private/2023-08/private_file.jpg

The header in XsendfileImageStyleDownloadController.php uses the Root-Directory of the Server as the root-path:x-sendfile: /var/www/html/private/styles/thumbnail/private/2023-08/private_file.jpg

Both approaches can work, but having the module return two different root-paths makes it difficult to distinguish the different paths in Nginx (and probably Apache too).

Steps to reproduce

Activate the Module and create some private pictures. media_library might help with creating ImageStyles.

Proposed resolution

We should decide on one default and then rewrite either of the functions to return an absolute or relative path.

Remaining tasks

  • Decide which root-path to take
  • Switch one of the root-paths

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇩🇪Germany RobinCS

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

Comments & Activities

Production build 0.71.5 2024