Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Prevent double encoding #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. A path parameter that contains a "=" can only be passed if it is encoded 
"%3D", but rest-assured would double encode this "%253D".

What is the expected output? What do you see instead?
Prevent double encoding or support pre-encode parameters.

What version of the product are you using? On what operating system?
1.2.2

Please provide any additional information below.

Interfacing into Jira where a query is a parameter:

https://jira.atlassian.com/rest/api/2.0.alpha1/search?jql=project%20=%20BAM%20AN
D%20issuetype%20=%20Bug

--- Code

public void resttest() {
RestAssured.baseURI = "https://jira.atlassian.com";
RestAssured.port = 443;
String query - "project%20=%20BAM%20AND%20issuetype%20=%20Bug";
String response = 
given().get("/rest/api/2.0.alpha1/search?jql={q}",query).andReturn().asString();
}

Original issue reported on code.google.com by alan.sa...@playfish.com on 26 Jul 2011 at 2:01

GoogleCodeExporter commented 9 years ago
Thanks for reporting. I'll have a look at this as soon as I can.

Original comment by johan.ha...@gmail.com on 2 Aug 2011 at 5:51

GoogleCodeExporter commented 9 years ago
This has been fixed in trunk now. You can specify e.g.

RestAssured.urlEncodingEnabled = false;

and it'll work.

Original comment by johan.ha...@gmail.com on 16 Aug 2011 at 12:37