edgeone 1.6.17 → 1.6.19
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.
|
@@ -561,14 +561,13 @@ async def app(scope: dict, receive, send) -> None:
|
|
|
561
561
|
for k, v in scope.get("headers", [])
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
#
|
|
565
|
-
# 部署环境下通过 eo-pages-host header 拼接完整 URL
|
|
566
|
-
# 对齐 agent-node: eo-pages-host 缺失时回退到 host header
|
|
564
|
+
# 计算完整请求路径和 scfRequestId(日志合并到 response 后统一打印)
|
|
567
565
|
_pages_host = headers.get("eo-pages-host", "") or headers.get("host", "")
|
|
566
|
+
_pages_full_path = path
|
|
568
567
|
if _pages_host:
|
|
569
568
|
_pages_proto = headers.get("x-forwarded-proto", "https")
|
|
570
569
|
_pages_full_path = f"{_pages_proto}://{_pages_host}{path}"
|
|
571
|
-
|
|
570
|
+
_scf_request_id = headers.get("x-scf-request-id", "")
|
|
572
571
|
|
|
573
572
|
# Dispatch to runtime. 同时起一个后台 task 监听 http.disconnect,
|
|
574
573
|
# 客户端主动断开(curl Ctrl+C、浏览器关标签、网关超时踢掉)时:
|
|
@@ -656,8 +655,8 @@ async def app(scope: dict, receive, send) -> None:
|
|
|
656
655
|
# 注意:这里不再立即 cancel watcher —— 流式分支需要它在 chunk 迭代时继续
|
|
657
656
|
# 监听 disconnect。非流式分支会在下面 send 完后统一 cancel。
|
|
658
657
|
|
|
659
|
-
#
|
|
660
|
-
print(f"Makers
|
|
658
|
+
# 统一日志:path + scfRequestId + statusCode 合并为一条
|
|
659
|
+
print(f"Makers request path: {_pages_full_path} |scfRequestId={_scf_request_id}|statusCode={result.status}|", file=sys.stderr, flush=True)
|
|
661
660
|
|
|
662
661
|
# Send response
|
|
663
662
|
response_headers = [(k.encode(), str(v).encode()) for k, v in result.headers.items()]
|