1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 17:55:06 +02:00
copilot-swe-agent[bot] a69400289d fix: prevent immutable cache headers on file access errors
When a file exists in the database as storedInternal but is missing from
disk, the error response was incorrectly getting Cache-Control:
max-age=31536000, immutable. This was because the handler set immutable
cache headers before attempting to stream the file, and by the time the
stream encountered the ENOENT error, HTTP headers were already committed.

Fix: add fs.promises.access() check in FileServerFileResolver for stored
original files before returning the path. If the file is not accessible
on disk, the access check throws, propagating to errorHandler which
correctly sets Cache-Control: max-age=300.

For thumbnail/webpublic stored files, detectType() already performed this
check implicitly via fs.stat(). Only original files were affected.

This fixes both the /files/:key and /proxy/:url* endpoints since both
call resolveFileByAccessKey for local files.

Agent-Logs-Url: https://github.com/misskey-dev/misskey/sessions/5dd1c781-b9ad-43cf-b107-79c502d2e602

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-04-07 13:31:53 +00:00
2025-12-06 17:39:17 +09:00
🎨
2025-05-07 10:44:43 +09:00
2025-07-16 15:49:05 +09:00
2025-09-27 20:53:21 +09:00
2026-04-07 19:30:26 +09:00
2025-10-19 11:34:34 +09:00
2026-01-05 20:56:52 +09:00
2025-07-16 15:49:05 +09:00
2026-01-05 20:56:52 +09:00
2025-12-06 17:39:17 +09:00
2025-08-07 17:21:43 +09:00
2026-01-01 00:00:00 +09:00
2026-04-07 11:42:38 +00:00
2026-01-07 21:43:31 +09:00
2025-11-11 09:30:13 +09:00
2025-02-01 13:57:39 +09:00

Misskey logo

🌎 Misskey is an open source, federated social media platform that's free forever! 🚀

Learn more


find an instance create an instance become a contributor join the community become a patron

Ask DeepWiki

Thanks

Sentry

Thanks to Sentry for providing the error tracking platform that helps us catch unexpected errors.

Chromatic

Thanks to Chromatic for providing the visual testing platform that helps us review UI changes and catch visual regressions.

Codecov

Thanks to Codecov for providing the code coverage platform that helps us improve our test coverage.

Crowdin

Thanks to Crowdin for providing the localization platform that helps us translate Misskey into many languages.

Docker

Thanks to Docker for providing the container platform that helps us run Misskey in production.


Support us with a !

Star History Chart

Description
🌎 A completely free and open interplanetary microblogging platform 🚀
https://github.com/misskey-dev/misskey Readme AGPL-3.0 607 MiB
Languages
TypeScript 64.5%
Vue 29%
JavaScript 5.7%
GLSL 0.3%
SCSS 0.3%