mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Forced hostname to end with /
This commit is contained in:
parent
f39199fa7e
commit
cfe23b57ff
2 changed files with 7 additions and 5 deletions
|
@ -39,7 +39,11 @@ public class Config implements JSONSource {
|
|||
apiKey = getElement(configObject, "apiKey").getAsString();
|
||||
username = getOptionalString(configObject, "username");
|
||||
password = getOptionalString(configObject, "password");
|
||||
hostname = getElement(configObject, "hostname").getAsString();
|
||||
String hostname = getElement(configObject, "hostname").getAsString();
|
||||
if (!hostname.endsWith("/")) {
|
||||
hostname += "/";
|
||||
}
|
||||
this.hostname = hostname;
|
||||
serviceName = getElement(configObject, "serviceName").getAsString();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,11 @@ public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
|||
private static String USERNAME;
|
||||
private static String PASSWORD;
|
||||
|
||||
/* Must end with / */
|
||||
private static String BASE_URL;
|
||||
|
||||
public SnapshotAPIRequest(String projectName, String apiCall) {
|
||||
super(BASE_URL + "/" + projectName + apiCall);
|
||||
super(BASE_URL + projectName + apiCall);
|
||||
}
|
||||
|
||||
protected Realm buildRequestRealm() {
|
||||
|
@ -31,9 +32,6 @@ public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
|||
}
|
||||
|
||||
public static void setBaseURL(String baseURL) {
|
||||
if (!(baseURL.endsWith("/"))) {
|
||||
baseURL += "/";
|
||||
}
|
||||
BASE_URL = baseURL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue