aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-09-29 09:28:10 +0200
committerSamuel Tardieu <sam@rfc1149.net>2011-09-29 09:35:32 +0200
commitb0d9f4d7384983daf9a277be6c1fd94559accea7 (patch)
tree64d8cb8dfb96b12a15875049787f38df2daf8dfc /main
parent3d79adad2e5152aa65ceef2ff8e6df0d8c3ad428 (diff)
downloadcgeo-b0d9f4d7384983daf9a277be6c1fd94559accea7.zip
cgeo-b0d9f4d7384983daf9a277be6c1fd94559accea7.tar.gz
cgeo-b0d9f4d7384983daf9a277be6c1fd94559accea7.tar.bz2
Reinstate params in the Okapi client
The params variable disappeared from the request during a bad refactoring. It needs to be properly encoded as the '|' character should not be present verbatim in requests. This was found during investigation of issue #540.
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
index bd0ddac..3373dee 100644
--- a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
+++ b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
@@ -55,7 +55,7 @@ final public class OkapiClient {
private static final String USER_USERNAME = "username";
private static final String SERVICE_CACHE = "/okapi/services/caches/geocache";
- private static final String SERVICE_CACHE_FIELDS = "fields=code|name|location|type|status|owner|founds|notfounds|size|difficulty|terrain|rating|rating_votes|recommendations|description|hint|images|latest_logs|date_hidden";
+ private static final String SERVICE_CACHE_FIELDS = "fields=" + cgBase.urlencode_rfc3986("code|name|location|type|status|owner|founds|notfounds|size|difficulty|terrain|rating|rating_votes|recommendations|description|hint|images|latest_logs|date_hidden");
public static cgCache getCache(final String geoCode) {
final String params = "cache_code=" + geoCode + "&" + SERVICE_CACHE_FIELDS;
@@ -252,7 +252,7 @@ final public class OkapiClient {
return null;
}
- final String uri = "http://" + connector.getHost() + service + "?" + ((ApiOpenCachingConnector) connector).getAuthentication(level);
+ final String uri = "http://" + connector.getHost() + service + "?" + params + ((ApiOpenCachingConnector) connector).getAuthentication(level);
return cgBase.requestJSON(uri);
}
}