Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoded url path parameter decoded via proxy #1097

Open
adsk-duszykf opened this issue May 3, 2024 · 0 comments
Open

Encoded url path parameter decoded via proxy #1097

adsk-duszykf opened this issue May 3, 2024 · 0 comments
Assignees
Labels

Comments

@adsk-duszykf
Copy link

Describe the bug

An encoded url parameter looks decoded by WireMock server. My code sends a request like : POST http://localhost:4200/api/file%3Atest.pdf to Wiremock proxy server. The url is then transformed to POST https://webservie.com/api/file:test.pdf. Here the url encoded parameter file%3Atest.pdf is decoded and forwarded as file:test.pdf which generate an error from the webservice

I

Expected behavior:

I expect that encoded url parameter are not decoded

Test to reproduce

  1. Create a mock server with proxy (here is my code)
MockServer = WireMockServer.Start(new WireMockServerSettings
{
    Urls = [BaseProxyURL],
    FileSystemHandler = new LocalFileSystemHandler(recordingPath),
});

MockServer
    .Given(Request.Create().WithPath($"*/service/*"))
    .RespondWith(Response.Create()
        .WithProxy(new ProxyAndRecordSettings
        {
            Url = "https://webservice.com/",

            SaveMapping = true,
            SaveMappingToFile = true,
            ExcludedHeaders = ["Authorization"],
            ReplaceSettings = new ProxyUrlReplaceSettings
            {
                OldValue = $"/service",
                NewValue = ""
            }
        })
    );
  1. Capture the outbound traffic with fiddler
  2. Send a request containing an encoded url parameter
@StefH StefH self-assigned this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants