🐛 fix: 整合官方 2.7.1 修复并升级定制版本
* 校验变更的出站地址并保留现有内部 CloudDrive 配置 * 修复未知长度上传、API 404 语义及下载令牌比较 * 合并 S3 小分片为符合最小尺寸要求的 multipart 部分 * 同步官方运行依赖、版本元数据和已推送前端版本 * 验证单元集成、覆盖率及定制上传下载兼容并记录整合范围
This commit is contained in:
1 parent
9ce9810b3b
commit
3b6949d862
14 files changed
+355
-31
No files matched your search
@@ -892,6 +892,19 @@ async def theme_asset(asset_path: str):
|
||||
|
||||
|
||||
@app.exception_handler(404)
|
||||
async def not_found_handler(request, exc=None):
|
||||
if request.url.path.startswith(("/assets/", "/theme-assets/")):
|
||||
return PlainTextResponse("Not found", status_code=404)
|
||||
# An API-raised 404 stays JSON even when a browser asks for HTML.
|
||||
if (request.scope.get("route") is None and request.method in {"GET", "HEAD"}
|
||||
and "text/html" in request.headers.get("accept", "")):
|
||||
try:
|
||||
return await index(request, exc)
|
||||
except HTTPException:
|
||||
pass
|
||||
return JSONResponse(status_code=404, content={"code": 404, "message": "Not Found", "msg": "Not Found", "detail": "资源不存在"})
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def index(request=None, exc=None):
|
||||
if request is not None and request.url.path.startswith(("/assets/", "/theme-assets/")):
|
||||
|
||||
Reference in new issue
Block a user