Repository navigation
Use 20-character random names for upload-only AI chat files - #358
Merged
Merged
Conversation
…y files Files in /etc/www/tmp/ are public only so an LLM can fetch them by their random URL. The default /etc/www/.config caches every static file with 'Cache-Control: public, max-age=31536000', which a CDN such as Cloudflare honours, so an upload kept being served from the CDN for up to a year after it was deleted. The static file server now overrides whatever .config says for anything under /etc/www/tmp/: Cache-Control no-store/private/max-age=0, CDN-Cache-Control and Cloudflare-CDN-Cache-Control no-store, Pragma no-cache, Expires 0, and X-Robots-Tag noindex/nofollow/noarchive. Double slashes and backslashes are normalised before the check. Every other static file is unchanged. Upload-only files in magic.ai.chat.hl now get 20 random characters instead of 10 (files sent to the LLM already get 25). Tests: two new tests in FileExecutorConfigTests (fail on master, pass here); magic.endpoint.tests 98/98 green on .NET 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per review: no folder-specific code in C#. This PR now only raises upload-only file names in magic.ai.chat.hl from 10 to 20 random characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Upload-only files in
magic.ai.chat.hlnow get 20 random characters instead of 10. Files sent to the LLM already get 25.The earlier C# change, which forced no-cache headers for
/etc/www/tmp/in the static file server, was removed after review: no folder-specific code in C#. Caching of/tmp/is handled on the Cloudflare side instead, with a cache rule that bypasses the cache for/tmp/*.