File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,13 @@ public Builder clientKey(String clientKey) {
142
142
* @return The same builder, for easy chaining.
143
143
*/
144
144
public Builder server (String server ) {
145
+
146
+ // Add an extra trailing slash so that Parse REST commands include
147
+ // the path as part of the server URL (i.e. http://api.myhost.com/parse)
148
+ if (server .charAt (server .length () - 1 ) != '/' ) {
149
+ server = server + "/" ;
150
+ }
151
+
145
152
this .server = server ;
146
153
return this ;
147
154
}
Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ public void testBuilder() {
30
30
Parse .Configuration .Builder builder = new Parse .Configuration .Builder (null );
31
31
builder .applicationId ("foo" );
32
32
builder .clientKey ("bar" );
33
- builder .server ("some.server " );
33
+ builder .server ("http://myserver.com/parse " );
34
34
builder .enableLocalDataStore ();
35
35
Parse .Configuration configuration = builder .build ();
36
36
37
37
assertNull (configuration .context );
38
38
assertEquals (configuration .applicationId , "foo" );
39
39
assertEquals (configuration .clientKey , "bar" );
40
- assertEquals (configuration .server , "some.server " );
40
+ assertEquals (configuration .server , "http://myserver.com/parse/ " );
41
41
assertEquals (configuration .localDataStoreEnabled , true );
42
42
}
43
43
You can’t perform that action at this time.
0 commit comments