Skip to content

Commit

Permalink
Set fallback to environment name for collection
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Feb 16, 2021
1 parent 5501fca commit 152eca7
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -6,6 +6,7 @@
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;

import dk.netarkivet.common.CommonSettings;
import dk.netarkivet.common.distribute.bitrepository.BitmagUtils;
import dk.netarkivet.common.utils.Settings;

Expand All @@ -30,10 +31,14 @@ public CGIRequestBuilder(URI uri) {
* Initializes the request builder and sets the default configurations that every request will have.
*/
private void setUpDefaultRequestBuilder() {
String collectionId = Settings.get(BitmagUtils.BITREPOSITORY_COLLECTIONID);
if (collectionId == null || "".equals(collectionId)) {
collectionId = Settings.get(CommonSettings.ENVIRONMENT_NAME);
}
requestBuilder = RequestBuilder.get()
.setUri(uri)
.addHeader("User-Agent", USER_AGENT)
.addParameter("collectionId", Settings.get(BitmagUtils.BITREPOSITORY_COLLECTIONID));
.addParameter("collectionId", collectionId);
}

/**
Expand Down

0 comments on commit 152eca7

Please sign in to comment.