From fb71facfeadb55524d5824d4078d4053717ae1a7 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 11 Apr 2017 23:18:29 -0700 Subject: [PATCH] Fix slash escape in REST API path addPathSegment escapes slash. This PR changes endpoint from rest%2Ffoo.view to rest/foo.view --- app/src/main/java/net/nullsum/audinaut/util/Util.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/nullsum/audinaut/util/Util.java b/app/src/main/java/net/nullsum/audinaut/util/Util.java index 5c9cd18..2e65d4b 100644 --- a/app/src/main/java/net/nullsum/audinaut/util/Util.java +++ b/app/src/main/java/net/nullsum/audinaut/util/Util.java @@ -350,7 +350,8 @@ public final class Util { String username = prefs.getString(Constants.PREFERENCES_KEY_USERNAME + instance, null); String password = prefs.getString(Constants.PREFERENCES_KEY_PASSWORD + instance, null); - builder.addPathSegment("rest/" + method + ".view"); + builder.addPathSegment("rest"); + builder.addPathSegment(method + ".view"); int hash = (username + password).hashCode(); Pair values = tokens.get(hash);