Honor forwarded headers when creating management URLs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
Research direction
Start in azure/durable_functions/models/DurableOrchestrationClient.py by reading get_client_response_links() and _replace_url_origin(). Use the source-level reproduction from the issue to trace how request.url replaces the management URL origin, then inspect the expected opt-in forwarded-header behavior. Done means trusted Forwarded or X-Forwarded headers produce the client-facing scheme and host while the default behavior remains unchanged.
Written by the indexing model from the issue text.
Description
🐛 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.
- Dominant language
- Python
- Stars
- 157
- Forks
- 70
- Avg merge
- 46m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/azure-functions-durable-python
-
Enhancement fixed-in-v2 P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-functions-durable-python#617 · 1 comment ·
-
bug Debuggability fixed-in-v2 P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-functions-durable-python#587 · 2 comments · 1 reaction ·
-
bug fixed-in-v2 P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Azure/azure-functions-durable-python#568 · 1 comment ·
-
bug fixed-in-v2 P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-functions-durable-python#475 · 1 comment ·
-
blocked bug fixed-in-v2 known-regression
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Azure/azure-functions-durable-python#600 · 3 comments ·
All issues in Azure/azure-functions-durable-python
Similar issues
-
tool-calling
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vllm-project/vllm#59838 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
raullenchai/Rapid-MLX#4042 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 92/100
transitmatters/mbta-slow-zone-bot#70 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
litestar-org/advanced-alchemy#811 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day