Repository navigation
v1.25.0
Static files: virtual file and directory aliases, defined by .aliases files
inside the served directory tree (see the README section
"Static files: .aliases").
StaticFilesAliases: a middleware in front of the static files handler.
It rewrites a request without a physical file to its alias target: exact
file alias, directory prefix, pattern (*,?,**/) or overlay (./).- The physical path always wins, so existing paths are served as before.
- Aliases can chain (max 8 levels, each entry once per chain), and cycles
are ignored. - Patterns are matched without backtracking blow-ups (memoized, no
RegExp). - Targets can't escape the
.aliasesdirectory (..and absolute paths
are rejected), and symlinks follow the existing root containment. - A virtual directory without a trailing
/is redirected with a302. .aliasesfiles (of existing directories), missing directories and
resolutions are cached and re-checked every 10s, in bounded caches
(evicting the oldest entries). A cached resolution costs ~130ns, and a
path without any applicable alias ~300ns.- An aliased file goes through the same pipeline as a physical file
(response cache, gzip,Cache-Control, cross-origin and cookieless
headers), sharing the physical path's cached response.
.aliasesfiles are never served: they respond404. Before, a
.aliasesfile in a served directory was served like any other file.
Also in this release (1.24.1, not released separately)
- Fix:
DBObjectDirectoryAdapter:selectAllandselectByIDsread all
their object files in parallel, so concurrent selects of a large table
opened thousands of files at once (not a leak, but an unbounded burst),
failing withToo many open files(errno = 24) under a low limit (macOS
default: 256). The reads are now limited by aFileLimitedsemaphore (50),
in batches of that limit per select.DBObjectDirectoryAdapter.fileLimited: the shared semaphore, tunable with
setSemaphoreLimit(FileLimitedis also exported by
bones_api_db_directory.dart).- An object deleted while a select waits to read it is skipped (no
existsSynccheck before the read: a missing file reads asnull),
and concurrent deletes of the same object delete it once (the others
delete nothing, without an exception).
FileLimited.readAsString: likeFile.readAsString, under the semaphore.- Fix:
FileLimited: an operation in flight whilesetSemaphoreLimit
replaced the semaphore released the new one (raising it above its limit);
it now releases the semaphore it acquired.