Simplify private file routing

Created on 27 October 2022, over 2 years ago
Updated 18 April 2023, about 2 years ago

Problem/Motivation

Fixing #3312198: Regression concerning the cache of private files is tricky because of PathProcessorFiles, which converts paths like system/files/path/to/private/file.txt to an internal path of system/files?file=path/to/private/file.txt.

PathProcessorFront claims that "the route system does not allow arbitrary amount of parameters", but Symfony supports it using route parameters and this is surely fixable in the rest of Drupal's routing system.

This would hopefully help to fix this issue and also solve a source of confusion about how the private file routing works, as I've had to trace through this before and it is always tricky.

Steps to reproduce

Proposed resolution

Refactor away PathProcessorFiles so it is no longer needed.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Needs work

Version

10.1

Component
File system 

Last updated about 12 hours ago

Created by

🇬🇧United Kingdom longwave UK

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom longwave UK

    🐛 Cannot use a / in route parameter Needs work has a possible better solution to the RouteProvider changes I made here.

  • 🇬🇧United Kingdom catch
  • First commit to issue fork.
  • Fixing #3312198: Regression concerning the cache of private files is tricky because of PathProcessorFiles, which converts paths like system/files/path/to/private/file.txt to an internal path of system/files?file=path/to/private/file.txt.

    From my findings, that doesn't seem to be the case if the file path is is within a folder such as 2022-10/test.txt, mainly because the current logic doesn't attempt to normalize the inbound URI path.

    Here's a simplified patch that works for me, as I haven't had time to test the other patch to see if it breaks anything else.

  • @codebymikey opened merge request.
Production build 0.71.5 2024