The file 'assets://js/.' does not exist

Created on 14 August 2025, about 9 hours ago

Problem/Motivation

Request for /sites/default/files/js/%252e results in a 500 error - The file 'assets://js/.' does not exist - When this should result in a 404 response (since the file does not exist).
The %25 is being first translated as a "%: character, and then %2e is decoded as a dot "."
Thus the %252e is a double-encoded dot. In AssetControllerBase code

$uri = 'assets://js/' . $file_name;
if (file_exists($uri)) {
return new BinaryFileResponse($uri, 200, ['Cache-control' => static::CACHE_CONTROL]);
}

file_exists will return true, because "." is a valid directory, and then BinaryFileResponse is called with a directory rather than a file, causing the exception.

Steps to reproduce

After aggregating files, make a request to /sites/default/files/js/%252e

Proposed resolution

Instead of "file_exists" use is_file so directories will not be passed to BinaryFileResponse()

πŸ› Bug report
Status

Active

Version

11.2 πŸ”₯

Component

asset library system

Created by

πŸ‡ΊπŸ‡ΈUnited States dgroene

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

Comments & Activities

Production build 0.71.5 2024