Skip to content

Commit 2243bfe

Browse files
Jason SwenskiChris Kleeschulte
authored andcommitted
Forgot to add ? in the URL params. A proper solution would use URIBuilder
I'll contribute this in a later pull request
1 parent cebab00 commit 2243bfe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/controller/BitPay.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,9 @@ private HttpResponse get(String uri, List<BasicNameValuePair> parameters, boolea
708708
HttpGet get = new HttpGet(fullURL);
709709

710710
if (parameters != null) {
711-
get.setURI(new URI(fullURL+URLEncodedUtils.format(parameters, "UTF-8")));
711+
712+
fullURL += "?" + URLEncodedUtils.format(parameters, "UTF-8");
713+
get.setURI(new URI(fullURL));
712714
}
713715
if(signatureRequired) {
714716
get.addHeader("x-signature", KeyUtils.sign(_ecKey, fullURL));
@@ -717,6 +719,7 @@ private HttpResponse get(String uri, List<BasicNameValuePair> parameters, boolea
717719
get.addHeader("x-bitpay-plugin-info", BITPAY_PLUGIN_INFO);
718720
get.addHeader("x-accept-version", BITPAY_API_VERSION);
719721

722+
720723
return _httpClient.execute(get);
721724

722725
} catch (URISyntaxException e) {
@@ -778,8 +781,10 @@ private HttpResponse delete(String uri, List<BasicNameValuePair> parameters) thr
778781
HttpDelete delete = new HttpDelete(fullURL);
779782

780783
if (parameters != null) {
784+
785+
fullURL += "?" + URLEncodedUtils.format(parameters, "UTF-8");
781786

782-
delete.setURI(new URI(fullURL+URLEncodedUtils.format(parameters, "UTF-8")));
787+
delete.setURI(new URI(fullURL));
783788

784789
delete.addHeader("x-bitpay-plugin-info", BITPAY_PLUGIN_INFO);
785790
delete.addHeader("x-accept-version", BITPAY_API_VERSION);

0 commit comments

Comments
 (0)