Problem/Motivation
With hotlink on and use_imagecache_root off, a file whose name has another
dot redirects to the origin without its extension. e.g. /sites/default/files/banner_v2.6.jpg redirects to https://origin.example.com/sites/default/files/banner_v2.6
StageFileProxySubscriber passes every path, not only image style derivatives, to ImageStyleDownloadController::getUriWithoutConvertedExtension(), which strips the ".jpg" because "banner_v2.6" still looks like it has an extension.
The same happens to a converted derivative (styles/large/public/foo.jpg.webp redirects without the .webp extension).
Steps to reproduce
1. Set origin, hotlink: true, use_imagecache_root: false.
2. Request /sites/default/files/banner_v2.6.jpg (not present locally).
3. The Location header ends in "banner_v2.6".
Proposed resolution
Only look for a converted extension on image style derivatives. and when hotlinking, redirect to the requested path and stop, this should let the origin generate the derivatives itself.
Remaining tasks
Provide MR.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork stage_file_proxy-3629123
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
codebymikey commentedComment #4
smustgrave commentedCan the MR be updated for 4.0.x? Or new MR opened
Comment #6
codebymikey commentedAdded the 4.0.x MR, and ran test-only pipeline to showcase the bug on both 3.1.x and 4.0.x - #3543794: stage_file_proxy use_imagecache_root TRUE breaks image style generation for filenames containing dots fixes some of the use cases with an explicit extension list, so there are less failures on 4.0.x, but doesn't fully cover the webp scenario properly.