dotnet / dotnet/yarp

.NET 6 Yarp is directing to path with %2F rather than /

Open
#1,777 15 comments 0 reactions 0 assignees View on GitHub
help wanted Type: Documentation
Dominant language
C#
Stars
9.6k
Forks
933
Avg merge
12d 18h
Merged PRs (30d)
2

Description

### Describe the bug
Text below copied from bug #1617, because it is exactly the same issue but not solved as wrote in #1617.

Since upgrading to .NET 6, I get 404s for a proxied request. When debugging my reverse proxy api, I am seeing that the {*path} in my path is getting it's /'s converted to %2F. I didn't change Yarp versions, only updated my target framework and other MS packages to 6.0 versions.

### To Reproduce
1. Configure route as following:
```json
"Routes": {
"Test": {
"Match": {
"Path": "/api/gwtest/{*path}"
},
"Order": 200,
"ClusterId": "clusterId",
"AuthorizationPolicy": "ValidateToken",
"Transforms": [
{
"PathPattern": "/api/{path}"
}
]
}
}
```

1. Request a resource such as /api/gwtest/p1/p2

This works perfectly in .NET 5, but in .NET 6 path portion has the slash transformed, which ultimately gives a 404.

### Further technical details
- Yarp.ReverseProxy 1.1.0
- The platform (Linux and Windows)

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.