-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding RestoreRawRequestPath middlware to restore the raw request path value to current request #9402
Conversation
…o the request context. This is an opt-in feature customers needs to explicitly opt-in.
Tested the build from this branch via private site extension. Created 2 sites, both has same code (changes from this PR). One has the feature enabled ( Site without the feature:https://shkr-9290-a-202307181948.azurewebsites.net/api/departments/cloud%2Fdevdiv - 404 - Routing failed. Site with the feature enabled:https://shkr-9290-b-202307182000.azurewebsites.net/api/departments/cloud%2Fdevdiv - 200 OK - Routing worked. |
src/WebJobs.Script.WebHost/Middleware/RestoreRawRequestPathMiddleware.cs
Show resolved
Hide resolved
src/WebJobs.Script.WebHost/Middleware/RestoreRawRequestPathMiddleware.cs
Show resolved
Hide resolved
src/WebJobs.Script.WebHost/WebJobsApplicationBuilderExtension.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: sarah <35204912+satvu@users.noreply.github.com>
@mattchenderson Let me know how do we want to proceed forward with this change? Did we hear any thing further from the platform folks? |
Any updates here? It looks code complete but I gather you're waiting on some input from another team? |
Closing this function level fix as we got confirmation from Antares team that this can be fixed on the platform level. https://msazure.visualstudio.com/Antares/_workitems/edit/25263505 is the (internal) work item tracking the fix. |
Any way for external interested parties to track the platform level fix? |
I'm also eager for a fix for this. I'm experiencing the issue with API's hosted from App Services. I need a fix for this asap |
Hey @kshyju, I just talked to the team that would be fixing this for the platform and they said they wouldn't be able to get to this until mid/late 2024 at the earliest. Can we revisit this PR as a stopgap and remove it whenever they get around to fixing it? I think this has a lot of value. |
Also unfortunately they have no clear way of tracking the change publicly. |
@mattchenderson Can you advice? |
Hi. Any way to have a workaround for this problem when hosting a DotNet web app with Azure App Services? It's a release blocker and we would never expect the azure internal proxy to magically alter parts of the original URL. |
Double url encode your route values as you build your url.Sent from my iPhoneOn Aug 28, 2024, at 06:44, Nik ***@***.***> wrote:
Hi. Any way to have a workaround for this problem when hosting a DotNet web app with Azure App Services? It's a release blocker and we would never expect the azure internal proxy to magically alter parts of the original URL.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
One issue..
|
Fixes #9290
The current behavior is caused by the App service front end decoding the encoded request path value before forwarding the request to the application (in this case functions host instance). When doing this, the front end stores the raw request path value it received and add it as a special request header.
Below are some relevant comments from other thread where this issue was discussed before.
and
The fix here is to use the
X-Waws-Unencoded-Url
header value which has the raw request path (un decoded) and update the request path with that so that the routing middleware can use that and route to the correct endpoint. I added a new middleware to do this. This is an opt-in feature customers needs to explicitly opt-in by setting theWEBSITE_RESTORE_RAW_REQUEST_PATH
app setting.This issue is a minimal repro of the original issue.
Pull request checklist
release_notes.md
Additional information