Setting origin_dir configuration to empty populates default

Created on 18 February 2021, over 3 years ago
Updated 29 June 2023, 12 months ago

Problem/Motivation

I have a site whom has all of their files at a vanity url https://assets1.eiqwebdemo.com. This is because they distribute their assets via S3. I assumed that I could set origin to the vanity url and origin_dir to either '/' or '', and get the files. The files don't exist on the production site as they use flysystem to push the assets to a default remote file system.

Steps to reproduce

You can easily reproduce this scenario with something like S3.

  1. Set up an s3 bucket
  2. push your drupal files directory to s3 at the root
  3. assign $config['stage_file_proxy.settings']['origin'] = 'https://YOURBUCKETCNAMEHERE';
  4. assign $config['stage_file_proxy.settings']['origin_dir'] = '';

The Expected results would be that stage_file_proxy would try to pull down https://YOURBUCKETCNAMEHERE/picture.jpg where picture.jpg was stored at public://picture.jpg

Proposed resolution

I propose that we distinguish between $config->get('origin_dir') being unset and equating to an empty string, therefore allowing one to set origin_dir to the root of a domain.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States generalredneck

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.

Production build 0.69.0 2024