Open Tratcher opened 3 years ago
Triage: Either ASP.NET makes the middleware more proxy friendly, or fork it. For v1 guidance might be sufficient
Related: #1331
This seems to be more of an issue with the middleware, rather than YARP. I'm wondering if this should be tracked with an issue in ASP.NET repo for .NET 7 rather than YARP.
@adityamandaleeka we will need ASP.NET 7.0 middleware work to light this up in YARP.
Thanks @karelz. @Tratcher is there an issue filed in aspnetcore for this already?
I've opened https://github.com/dotnet/aspnetcore/issues/39423. We'll want to react to those changes in YARP when they are available.
ASP.NET Core has a UseForwardedHeaders middleware that processes incoming x-forwarded-* headers and applies them to the request. Here are things it does:
That middleware design assumes the app is the endpoint, it doesn't work well if the request is going to be forwarded since it's modified the request headers and fields. Today's proxy x-forwarded transforms would technically work since they'd take the current RemoteIp/Port/Scheme/Host fields from the requests and append them to the headers, but intermediate values from those headers would be lost.
UseForwardedHeaders probably needs some (opt-in?) design updates:
The proxy's x-forwarded transform logic would need to check for the new feature with the original values and use those rather than the current values.