Skip to content

Commit

Permalink
Fix monitoring paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre committed Jan 12, 2024
1 parent 66c8580 commit 15d1b96
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import no.ssb.klass.core.service.SearchService;
import no.ssb.klass.core.service.UserService;
import no.ssb.klass.core.service.search.SolrSearchResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
Expand Down Expand Up @@ -71,8 +72,11 @@ private MonitorStatus testDatabaseConnection() {
private MonitorStatus testRestAPI(HttpServletRequest request) {
try {
String currentUrl = getCurrentUrl(request);
if (StringUtils.isNotBlank(basePath)) {
currentUrl = currentUrl + "/" + basePath;
}

String testUrl = currentUrl + basePath + RestConstants.API_VERSION_V1 + "/classifications";
String testUrl = currentUrl + RestConstants.API_VERSION_V1 + "/classifications";
URL url = new URL(testUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
int responseCode = connection.getResponseCode();
Expand Down

0 comments on commit 15d1b96

Please sign in to comment.