✨ feat: 整合 2.8.5 后端存储、安全与运行优化
* 禁用 OSS 非必需校验尾部,改用精确会话前缀逐对象清理 * 保护上传终态与分享事务,清理失败保留会话并支持安全重试 * 统一下载响应头,兼容旧下载器并防止文件名注入 * 限流改用单调时钟并限制 IP 记录,缓存模板与静态资源策略 * 统一 ORM 初始化与异常处理,新增查询索引及 SQLite 性能参数 * 固定 uvloop/httptools,统一 Docker keep-alive 与内存回收配置 * 同步版本与升级文档,补充 OSS、清理、缓存及数据库回归验证
This commit is contained in:
1 parent
b2a9aeddb3
commit
41519afb6a
29 files changed
+1033
-132
No files matched your search
@@ -13,7 +13,7 @@ from __future__ import annotations
|
||||
|
||||
import time
|
||||
from pathlib import Path
|
||||
from urllib.parse import quote
|
||||
from core.storage import build_attachment_headers
|
||||
|
||||
from fastapi import HTTPException
|
||||
|
||||
@@ -96,8 +96,7 @@ def build_local_ref_download(file_code) -> FileResponse:
|
||||
filename = f"{getattr(file_code, 'prefix', '') or ''}{getattr(file_code, 'suffix', '') or ''}"
|
||||
if not filename:
|
||||
filename = path.name
|
||||
encoded_filename = quote(filename, safe="")
|
||||
headers = {"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"}
|
||||
headers = build_attachment_headers(filename)
|
||||
try:
|
||||
headers["Content-Length"] = str(path.stat().st_size)
|
||||
except OSError:
|
||||
|
||||
Reference in new issue
Block a user