mockserver icon indicating copy to clipboard operation
mockserver copied to clipboard

Repeated query parameters with the same value are missing from queryStringParameters

Open simontankersley opened this issue 1 year ago • 0 comments

Describe the issue I noticed that the value of queryStringParameters does not accurately reflect the query parameters passed in a request when the request contains a repeated query parameter name and value.

What you are trying to do I was trying to see the query parameters sent in a request

MockServer version 5.15.0

To Reproduce Steps to reproduce the issue:

docker run -d --name mockserver --rm -p 1080:1080 mockserver/mockserver:5.15.0
curl 'http://localhost:1080?q=1&q=1&q=2'
docker logs mockserver

Expected behaviour I expected to see in the log output:

    "queryStringParameters" : {
      "q" : [ "1", "1", "2" ]
    },

but instead saw only

    "queryStringParameters" : {
      "q" : [ "1", "2" ]
    },

MockServer Log

2024-04-26 19:27:43 5.15.0 INFO using environment variables:

  [
  	SERVER_PORT=1080
  ]

 and system properties:

  [
  	mockserver.propertyFile=/config/mockserver.properties
  ]

 and command line options:

  [

  ]

2024-04-26 19:27:44 5.15.0 INFO logger level is INFO, change using:
 - 'ConfigurationProperties.logLevel(String level)' in Java code,
 - '-logLevel' command line argument,
 - 'mockserver.logLevel' JVM system property or,
 - 'mockserver.logLevel' property value in 'mockserver.properties'
2024-04-26 19:27:44 5.15.0 INFO 1080 started on port: 1080
2024-04-26 19:28:07 5.15.0 INFO 1080 received request:

  {
    "method" : "GET",
    "path" : "/",
    "queryStringParameters" : {
      "q" : [ "1", "2" ]
    },
    "headers" : {
      "content-length" : [ "0" ],
      "User-Agent" : [ "curl/8.4.0" ],
      "Host" : [ "localhost:1080" ],
      "Accept" : [ "*/*" ]
    },
    "keepAlive" : true,
    "secure" : false,
    "protocol" : "HTTP_1_1",
    "localAddress" : "64a9e172857d/172.17.0.2:1080",
    "remoteAddress" : "192.168.65.1:22084"
  }

2024-04-26 19:28:07 5.15.0 INFO 1080 no expectation for:

  {
    "method" : "GET",
    "path" : "/",
    "queryStringParameters" : {
      "q" : [ "1", "2" ]
    },
    "headers" : {
      "content-length" : [ "0" ],
      "User-Agent" : [ "curl/8.4.0" ],
      "Host" : [ "localhost:1080" ],
      "Accept" : [ "*/*" ]
    },
    "keepAlive" : true,
    "secure" : false,
    "protocol" : "HTTP_1_1",
    "localAddress" : "64a9e172857d/172.17.0.2:1080",
    "remoteAddress" : "192.168.65.1:22084"
  }

 returning response:

  {
    "statusCode" : 404,
    "reasonPhrase" : "Not Found"
  }

simontankersley avatar Apr 26 '24 19:04 simontankersley