bizydraft 0.2.64__py3-none-any.whl → 0.2.65__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bizydraft might be problematic. Click here for more details.
- bizydraft/patch_handlers.py +10 -4
- {bizydraft-0.2.64.dist-info → bizydraft-0.2.65.dist-info}/METADATA +1 -1
- {bizydraft-0.2.64.dist-info → bizydraft-0.2.65.dist-info}/RECORD +5 -5
- {bizydraft-0.2.64.dist-info → bizydraft-0.2.65.dist-info}/WHEEL +0 -0
- {bizydraft-0.2.64.dist-info → bizydraft-0.2.65.dist-info}/top_level.txt +0 -0
bizydraft/patch_handlers.py
CHANGED
|
@@ -50,7 +50,7 @@ async def view_image(request):
|
|
|
50
50
|
try:
|
|
51
51
|
if "http" in subfolder:
|
|
52
52
|
subfolder = subfolder[subfolder.find("http") :]
|
|
53
|
-
subfolder = unquote(subfolder)
|
|
53
|
+
subfolder = unquote(subfolder).replace("https:/", "https://")
|
|
54
54
|
filename = (
|
|
55
55
|
f"{subfolder}/{filename}"
|
|
56
56
|
if not filename.startswith(http_prefix_options)
|
|
@@ -58,13 +58,19 @@ async def view_image(request):
|
|
|
58
58
|
) # preview 3d request: https://host:port/api/view?filename=filename.glb&type=output&subfolder=https://bizyair-dev.oss-cn-shanghai.aliyuncs.com/outputs&rand=0.5763957215362988
|
|
59
59
|
|
|
60
60
|
content_type, _ = mimetypes.guess_type(filename)
|
|
61
|
-
if content_type and any(x in content_type for x in ("image", "video")):
|
|
62
|
-
return web.HTTPFound(filename)
|
|
63
61
|
|
|
64
62
|
timeout = ClientTimeout(total=BIZYDRAFT_REQUEST_TIMEOUT)
|
|
65
63
|
async with ClientSession(timeout=timeout) as session:
|
|
66
64
|
async with session.get(filename) as resp:
|
|
67
65
|
resp.raise_for_status()
|
|
66
|
+
|
|
67
|
+
# 优先使用服务器返回的Content-Type,如果无法获取则使用猜测的类型
|
|
68
|
+
final_content_type = (
|
|
69
|
+
resp.headers.get("Content-Type")
|
|
70
|
+
or content_type
|
|
71
|
+
or "application/octet-stream"
|
|
72
|
+
)
|
|
73
|
+
|
|
68
74
|
content_length = int(resp.headers.get("Content-Length", 0))
|
|
69
75
|
if content_length > BIZYDRAFT_MAX_FILE_SIZE:
|
|
70
76
|
logger.warning(
|
|
@@ -77,7 +83,7 @@ async def view_image(request):
|
|
|
77
83
|
|
|
78
84
|
headers = {
|
|
79
85
|
"Content-Disposition": f'attachment; filename="{uuid.uuid4()}"',
|
|
80
|
-
"Content-Type":
|
|
86
|
+
"Content-Type": final_content_type,
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
proxy_response = web.StreamResponse(headers=headers)
|
|
@@ -4,7 +4,7 @@ bizydraft/env.py,sha256=VFmGopVL2TGWA6hwxyFhIglCEcQxy6iVvL_raMNd6u4,407
|
|
|
4
4
|
bizydraft/hijack_nodes.py,sha256=flE0FH3pDUBAej5T3X-DiyLwxSz478OFC4ewcNLUBvM,3466
|
|
5
5
|
bizydraft/hijack_routes.py,sha256=lf6x3xDzbo9yQIRwfG_1oxcUNfrX_1ogbiff3WOV9gM,3268
|
|
6
6
|
bizydraft/oss_utils.py,sha256=FxTe9TxA9Q13pxKaOpcN0Jui-BG1SBWySM71PqpIlsM,8601
|
|
7
|
-
bizydraft/patch_handlers.py,sha256=
|
|
7
|
+
bizydraft/patch_handlers.py,sha256=341y4YpzXOngQk9vLO8KLr7MXqAgM-_DrGrtIVGbPWo,6193
|
|
8
8
|
bizydraft/postload.py,sha256=XFElKcmCajT_oO7SVJJBaN04XcWro54N5HB5cSCxfvI,1308
|
|
9
9
|
bizydraft/prestartup_patch.py,sha256=4FGjmRcDHELjtlQOrfTfk2Un5OS89QIqfq-gEcB9WDs,998
|
|
10
10
|
bizydraft/resp.py,sha256=8INvKOe5Dgai3peKfqKjrhUoYeuXWXn358w30-_cY-A,369
|
|
@@ -23,7 +23,7 @@ bizydraft/static/js/socket.js,sha256=VE3fTAgEfM0FZhL526Skt7OCRokOa3mzTCAjAomI_tE
|
|
|
23
23
|
bizydraft/static/js/tool.js,sha256=VupamUuh7tYiDnBTrL5Z_yLmhJinskhzRXwE3zfsKZM,2901
|
|
24
24
|
bizydraft/static/js/uploadFile.js,sha256=WvglKzHMeOzDhOH3P-fLcPHxCLbKOJpo4DntoRxeJtI,4908
|
|
25
25
|
bizydraft/static/js/workflow_io.js,sha256=FWAjncvWhvy-3nN_legD2fpRwgnIncpRLHU5X016a-U,5236
|
|
26
|
-
bizydraft-0.2.
|
|
27
|
-
bizydraft-0.2.
|
|
28
|
-
bizydraft-0.2.
|
|
29
|
-
bizydraft-0.2.
|
|
26
|
+
bizydraft-0.2.65.dist-info/METADATA,sha256=C4ZX1SbyFzrB-6ABgnyvncqMI87fQqOAnJ-rtt8lSbM,162
|
|
27
|
+
bizydraft-0.2.65.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
bizydraft-0.2.65.dist-info/top_level.txt,sha256=XtoBq6hjZhXIM7aas4GtPDtAiKo8FdLzMABXW8qqQ8M,10
|
|
29
|
+
bizydraft-0.2.65.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|