mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Forced hostname to end with /
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user