Skip to content

Downstream ending with / (slash) - Version 23.x.x #2278

@willsbctm

Description

@willsbctm

The / is not being propagated downstream.

Expected Behavior

Using version Ocelot 22.x.x with the following setup:

{
    "Routes": [
        {
            "DownstreamScheme": "http",
            "UpstreamPathTemplate": "/api/v1/endpoint-slash",
            "UpstreamHttpMethod": [
                "Get"
            ],
            "DownstreamPathTemplate": "/v1/endpoint-slash/",
            "AuthenticationOptions": {
                "AuthenticationProviderKey": "Jwt-IDM"
            },
            "DownstreamHostAndPorts": [
                {
                    "Host": "localhost",
                    "Port": 8885
                }
            ]
        }
    ]
}

We got the slash at the end of the downtream applied path:

Image

Actual Behavior

Using version Ocelot 23.x.x with the following setup:

{
    "Routes": [
        {
            "DownstreamScheme": "http",
            "UpstreamPathTemplate": "/api/v1/endpoint-slash",
            "UpstreamHttpMethod": [
                "Get"
            ],
            "DownstreamPathTemplate": "/v1/endpoint-slash/",
            "AuthenticationOptions": {
                "AuthenticationProviderKey": "Jwt-IDM"
            },
            "DownstreamHostAndPorts": [
                {
                    "Host": "localhost",
                    "Port": 8885
                }
            ]
        }
    ]
}

We didn't get the slash at the end of the downtream applied path:

Image

Is that a problem or is that an expected behaviour?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    RoutingOcelot feature: RoutingquestionInitially seen a question could become a new feature or bug or closed ;)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions