Skip to content

Conversation

@lucadelauw
Copy link

When Azure Functions applications are deployed behind proxies or load balancers (such as Azure Application Gateway), the 'x-forwarded-port' header may contain multiple comma-separated port values (e.g., "443,8080,433"). The current implementation attempts to convert the entire string to an integer, which causes an error and subsequent function crash.

My fix extracts the first port value from this header and also strips whitespaces. Also included new tests for these

see: Azure/azure-functions-python-worker#1768

@lucadelauw
Copy link
Author

@microsoft-github-policy-service agree

@lucadelauw
Copy link
Author

lucadelauw commented Nov 6, 2025

Can this please be looked at since it's quite a blocking issue. This is a fairly straightforward fix
@hallvictoria Would be highly appreciated if we can slip this into the next release. Thanks!

@hallvictoria
Copy link
Contributor

Hi @lucadelauw, thanks for this. Our next beta release (1.25.0b2) has a lot of changes currently, but we can look at taking this in the beta release after (1.25.0b3). ETA for b3 release will be ~end of this week to unblock this scenario

@hallvictoria
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@hallvictoria
Copy link
Contributor

Hey @lucadelauw, I noticed that this PR doesn't fix the original scenario based on the bug report, where the x-forwarded-port value being passed in is 90344081.test.com. I had a couple other comments, so thought it'd be easier if I opened a separate PR for this #307. Please feel free to take a look and make sure it helps your scenario!

@lucadelauw
Copy link
Author

I see. I indeed just implemented the scenario that I specifically had issues with. Your new PR seems to cover that and more. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants