fix(api): cap the total size of a client cache upload and clean up after a refused session create

This commit is contained in:
imSp4rky
2026-11-26 13:40:05 -07:00
parent ed3b772793
commit 625e632b53
6 changed files with 184 additions and 60 deletions
+1 -1
View File
@@ -666,7 +666,7 @@ suffix, which is the `Cacher` cache key the service reads it with:
Both sides reject a cache key with a drive letter, a root, a `..` segment, an empty
segment, or more than 8 segments before it becomes a path, so a peer cannot write
outside the cache directory. Both sides also refuse a `cache` map with more than
256 entries, and the server refuses the request body of a remote session creation or of a search when it is larger than 8 MiB. The client gives a warning when it has more than 256 cache files to send. The server skips a cache key it cannot write, such as one that names an
256 entries, and the server refuses the request body of a remote session creation or of a search when it is larger than 8 MiB. The server also refuses a `cache` map whose files inflate to more than 16 MiB in total, with `400 INVALID_INPUT`. It checks every entry before it writes a file, and it removes the cache directory of a remote session creation that fails. The client gives a warning when it has more than 256 cache files or more than 16 MiB to send. It also stops saving the cache files that a server returns at 16 MiB. The server skips a cache key it cannot write, such as one that names an
existing file as a directory, and logs a warning.
### Remote session info response