- Issue created by @hanoii
- Merge request !93properly use the complete Drupal basePath as the PublicPath() β (Open) created by hanoii
- πΊπΈUnited States smustgrave
Possible dup https://www.drupal.org/project/stage_file_proxy/issues/3499660 π Files are not proxied when Drupal is not in the webroot Needs work
Either way probably should have a test
- π¦π·Argentina hanoii π¦π·UTC-3
Hmm, definitely a dupe, I tried searching for something similar but my keyword-fu was probably not on its peak. I will comment there, I think this patch is cleaner and rely on a core function rather than string replacements.
- π§πͺBelgium lisotton Brussels
Issue was already fixed in the latest version of the module.
- π¦π·Argentina hanoii π¦π·UTC-3
I kind of feel that this is a better fix, it's doing a lot of things that are really not necessary:
diff --git a/src/DownloadManager.php b/src/DownloadManager.php index ae73c0c2cb17e267bf318f6a428810a10d2908b3..bf5a00e1a7762606b52ea5c6402f69d0874fa728 100644 --- a/src/DownloadManager.php +++ b/src/DownloadManager.php @@ -140,11 +140,7 @@ final class DownloadManager implements DownloadManagerInterface { * {@inheritdoc} */ public function filePublicPath(): string { - $request = $this->requestStack->getCurrentRequest(); - $filesDir = PublicStream::baseUrl(); - $host = $request->getSchemeAndHttpHost(); - $basePath = $request->getBasePath(); - return str_replace($host . $basePath . '/', '', $filesDir); + return PublicStream::basePath(); } /**
Why do all that to remove things from baseUrl() when base basePath() already gives yo what you want?