I'm trying to debug a route that should work like the one(s) used by the private: file scheme (i.e., a path like system/files/path/to/file, where path/to/file is an arbitrary string that may contain '/' characters). I more or less copied the the router definition. For private files:
system.private_file_download:
path: '/system/files/{filepath}'
defaults:
_controller: 'Drupal\system\FileDownloadController::download'
requirements:
# Permissive regex to allow slashes in filepath see
# http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html
filepath: .+
_access: 'TRUE'
For my "knock-off", which uses a custom scheme called 'session:':
file_example.files.session:
path: '/example/file_example/files/{filepath}'
defaults:
_controller: '\Drupal\system\FileDownloadController::download'
scheme: session
requirements:
# Permissive regex to allow slashes in filepath see
# http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html
filepath: .+
_access: 'TRUE'
As near as I can tell, my route is never matched; yet the private: case works. What's different here? How can I debug how the router makes its decisions?
Part of what I need to know is just what route got picked when the private: scheme actually works. So it would be handy to get a link to the current route. This is a fairly obvious thing to do, but I can't find a reference in the docs. How can I determine what the "current route" is for current request?