API call isn't matched when using an empty query string parameter #669

Closed
opened 2025-12-29 15:30:23 +01:00 by adam · 1 comment
Owner

Originally created by @domwvitality on GitHub (Jan 29, 2025).

Originally assigned to: @StefH on GitHub.

Describe the bug

When adding a query string parameter with an empty value the API call isn't matched.

Expected behavior:

The API call should be match when using a query string parameter with an empty value.

Test to reproduce

Using this API call http://localhost:9998/path?type=

This will match:

server
    .Given(Request.Create()
            .WithPath("/path")
            .UsingGet())
    .RespondWith(Response.Create()
            .WithStatusCode(200));

This won't match:

server
    .Given(Request.Create()
            .WithPath("/path")
            .WithParam("type", "")
            .UsingGet())
    .RespondWith(Response.Create()
            .WithStatusCode(200));
Originally created by @domwvitality on GitHub (Jan 29, 2025). Originally assigned to: @StefH on GitHub. ### Describe the bug When adding a query string parameter with an empty value the API call isn't matched. ### Expected behavior: The API call should be match when using a query string parameter with an empty value. ### Test to reproduce Using this API call `http://localhost:9998/path?type=` This will match: ```c# server .Given(Request.Create() .WithPath("/path") .UsingGet()) .RespondWith(Response.Create() .WithStatusCode(200)); ``` This won't match: ```c# server .Given(Request.Create() .WithPath("/path") .WithParam("type", "") .UsingGet()) .RespondWith(Response.Create() .WithStatusCode(200)); ```
adam added the bug label 2025-12-29 15:30:23 +01:00
adam closed this issue 2025-12-29 15:30:23 +01:00
Author
Owner

@StefH commented on GitHub (Feb 13, 2025):

https://github.com/WireMock-Net/WireMock.Net/pull/1253

@StefH commented on GitHub (Feb 13, 2025): https://github.com/WireMock-Net/WireMock.Net/pull/1253
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#669