microsoft / microsoft/aspire

Yarp - Support Custom Transforms

Open
#13,719 2 comments 0 reactions 0 assignees View on GitHub
area-integrations
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

With the Yarp package (on its own), you can create your own custom request and response transforms. With this, you can do things like adjust the `Domain` attribute for `Set-Cookie` and `Cookie` headers. Since you can only use name-based transforms with the Yarp integration, these things are not possible strictly with Aspire. To get around this, I had to create a separate project in my solution that directly uses the Yarp package solely to perform this header rewrite, while configuring everything else in the reverse proxy via Aspire.

### Describe the solution you'd like

Add new `WithCustom*Transform` methods with the following signatures (or something similar):
```csharp
public static YarpRoute WithCustomRequestTransform(this YarpRoute route, Func func);

public static YarpRoute WithCustomResponseTransform(this YarpRoute route, Func func);
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.