dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.24k stars 316 forks source link

[release/8.0] YARP: add special-case for localhost when setting Host value #4076

Closed github-actions[bot] closed 1 month ago

github-actions[bot] commented 1 month ago

Backport of #4069 to release/8.0

/cc @ReubenBond

Customer Impact

This fix is localized to the YARP Service Discovery integration. It fixes the localhost+HTTPS scenario from the linked bug: https://github.com/dotnet/aspire/issues/3991. Previously, that would fail due to mismatch between the dev cert and the Host header.

Testing

Tests added, customer validated private build.

Risk

Very low. This behavior is localized to YARP+SD and only takes effect when a URI resolves to localhost and no Host value was explicitly set in YARP configuration.

Regression?

No

Microsoft Reviewers: Open in CodeFlow