Honor forwarded headers when creating management URLs
还没有人认领这个 Issue。
评估
调研方向
从 azure/durable_functions/models/DurableOrchestrationClient.py 开始,阅读 get_client_response_links() 和 _replace_url_origin()。使用 issue 中的源代码级复现,跟踪 request.url 如何替换管理 URL 的 origin,然后检查预期的转发 header opt-in 行为。当受信任的 Forwarded 或 X-Forwarded header 产生面向客户端的 scheme 和 host,同时默认行为保持不变时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
🐛 Describe the bug
A clear and concise description of what the bug is.
DurableOrchestrationClient.create_check_status_response() and get_client_response_links() do not consider Forwarded, X-Forwarded-Host, or X-Forwarded-Proto when constructing management URLs.
The SDK copies the extension-provided management URL templates, then unconditionally replaces their origin with the scheme and authority from request.url. Behind Azure Front Door, Application Gateway, or another reverse proxy, request.url can contain the internal origin. The resulting Location, statusQueryGetUri, and other management URLs can therefore expose an internal hostname or use HTTP even when forwarded headers describe the public HTTPS origin.
The Durable Functions extension added opt-in forwarded-header support in Azure/azure-functions-durable-extension#3083. Out-of-process binding templates are generated without an HTTP request, however, and the Python SDK subsequently replaces their origin from request.url, so that extension behavior does not cover this Python path.
This is separate from #355: current Azure Linux managed hosting correctly returns HTTPS management URLs for ordinary HTTPS-only Function Apps.
🤔 Expected behavior
What should have happened?
When trusted forwarded-header handling is enabled, Python-generated management URLs should use the client-facing scheme and host from Forwarded or X-Forwarded-Proto/X-Forwarded-Host, consistent with the Durable Functions extension behavior. Without opt-in, existing request.url behavior should remain unchanged.
☕ Steps to reproduce
What Durable Functions patterns are you using, if any?
Any minimal reproducer we can use?
Are you running this locally or on Azure?
- Run a Python Durable Functions HTTP starter behind a reverse proxy.
- Have the proxy forward a public HTTPS origin using
X-Forwarded-Proto: httpsandX-Forwarded-Host: public.example.com, while the worker receives an internalrequest.urlsuch ashttp://internal.example/api/start. - Return
client.create_check_status_response(req, instance_id). - Observe that the management URL origins use
http://internal.examplerather thanhttps://public.example.com.
A source-level reproduction is also sufficient: initialize the client with an HTTPS management URL template, call get_client_response_links() with an HTTP request.url, and observe that _replace_url_origin() downgrades the template to HTTP.
Relevant implementation: azure/durable_functions/models/DurableOrchestrationClient.py, in get_client_response_links() and _replace_url_origin().
⚡If deployed to Azure
We have access to a lot of telemetry that can help with investigations. Please provide as much of the following information as you can to help us investigate!
- Timeframe issue observed: N/A; identified through source analysis of reverse-proxy behavior
- Function App name: N/A
- Function name(s): N/A
- Azure region: N/A
- Orchestration instance ID(s): N/A
- Azure storage account name: N/A
If you don't want to share your Function App or storage account name GitHub, please at least share the orchestration instance ID. Otherwise it's extremely difficult to look up information.
- 主要语言
- Python
- 星标
- 157
- 派生
- 71
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/azure-functions-durable-python 的其他 Issue
-
Enhancement fixed-in-v2 P3
难度 2/5 1-3 小时 新手友好度 72/100
Azure/azure-functions-durable-python#617 · 1 条评论 ·
-
bug Debuggability fixed-in-v2 P2
难度 2/5 1-3 小时 新手友好度 72/100
Azure/azure-functions-durable-python#587 · 2 条评论 · 1 个 reaction ·
-
Custom object serialization broken for orchestrator return values可能已有人在做 @andystaples 于 81 天前认领。 未关闭bug fixed-in-v2 P2
难度 2/5 1-3 小时 新手友好度 75/100
Azure/azure-functions-durable-python#568 · 1 条评论 ·
-
bug fixed-in-v2 P3
难度 2/5 1-3 小时 新手友好度 72/100
Azure/azure-functions-durable-python#475 · 1 条评论 ·
-
blocked bug fixed-in-v2 known-regression
难度 4/5 3-5 天 新手友好度 45/100
Azure/azure-functions-durable-python#600 · 3 条评论 ·
查看 Azure/azure-functions-durable-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
[Device Support Request] HOBEIAN ZG-204ZL (Tuya PIR motion sensor with illuminance)可能已有人在做 @lenucksi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
zigpy/zha-device-handlers#5493 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
drevendev/BeautifulRepo#42 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
writerslogic/holographic-memory#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
antoine-tena/kiln#47 ·
维护者通常 1 天内回复