Skip to content

The query string is built incorrectly when the path contains a parameter #87

@simoncas

Description

@simoncas

Describe the bug
The URL is crafted incorrectly when the path already contains a query string and when additional parameters are added through the options.
Example: https://reqres.in/api/users?param1=value1?param2=value2

To Reproduce
Steps to reproduce the behavior:
url: http://whatever.com
path: /whatever?param1=value1
parameters: param2 as Key1 and value2 as Value1
Open the developer tools and select the network tab. Filter requests by XHR
Send the request by hitting the Send button.
Using the developer tools, analyze the HTTP request crafted by postwoman, especially the URL

The URL is https://reqres.in/api/users?param1=value1?param2=value2 which isn't valid. The query string isn't valid since the parameters are preceded twice by a question mark. The second parameter should be preceded by a "&" instead.

Expected behavior
The crafted URL should be https://reqres.in/api/users?param1=value1&param2=value2.
In other words, if the path already contains a query string then the additional parameters specified through the parameter section must be correctly added.

Screenshots
Screenshot from 2019-08-28 18-36-24

Screenshot from 2019-08-28 18-34-09

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions