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

Repeated query parameters with the same value are missing from queryStringParameters #1866

Open
simontankersley opened this issue Apr 26, 2024 · 0 comments

Comments

@simontankersley
Copy link

simontankersley commented Apr 26, 2024

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"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant