dotnet / dotnet/yarp

Double percent encoding of forward slashes (%2F) in paths

Open
#1,419 15 comments 13 reactions 0 assignees View on GitHub
External: AspNetCore Type: Bug Type: Tracking
Dominant language
C#
Stars
9.6k
Forks
933
Avg merge
12d 18h
Merged PRs (30d)
2

Description

### Describe the bug
we use yarp in front of an nexus server which hosting node packages.
Node packages urls can contains %2f instead of slash as part of the path.
yarp encode the percent again to %25 so the resulting path was wrongly modifed.

### To Reproduce

`GET https://nexus.domain.com/repository/npm-proxy/@types%2fcors`

YARP convert the url to, but its wrong:
`https://nexus.domain.com/repository/npm-proxy/@types%252fcors`

YARP should not modify the path by default. If there is a special use case for duing that, it should be done by a feature flag

### Further technical details

We tested it with new version 1.0.0 / .net 5.0

We analysed the issue in detail and found the reason for this issue: #
By fixing the issue #1219 a major change was done with path encoding.
The char '%' was not longer a valid path character for yarp. (Class RequestUtilities, Method: IsValidPathChar)

We temporary fix the issue by creating a custom request transformer and set the uri like RequestUtilities did it before.

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.