Skip to content

Commit

Permalink
fix: fix compilation errors #651 (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 authored Dec 9, 2022
1 parent 42c89c0 commit f9728d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.jans.orm.search.filter.Filter;
import io.jans.fido2.client.AttestationService;
import io.jans.fido2.model.entry.Fido2RegistrationStatus;
import io.jans.orm.model.fido2.Fido2RegistrationStatus;

import java.net.URL;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
Expand Down Expand Up @@ -208,11 +206,7 @@ private JsonNode getGeoLocation(String ip, String urlPattern, int timeout) {

}

private String getUrlContents(String url, int timeout) throws Exception{
return getUrlContents(url, Collections.emptyList(), timeout);
}

private String getUrlContents(String url, List<NameValuePair> nvPairList, int timeout) throws Exception {
private String getUrlContents(String url, int timeout) throws Exception {

String contents = null;

Expand All @@ -223,15 +217,14 @@ private String getUrlContents(String url, List<NameValuePair> nvPairList, int ti

HttpGet httpGet = new HttpGet(url);
URIBuilder uribe = new URIBuilder(httpGet.getURI());
nvPairList.forEach(pair -> uribe.addParameter(pair.getName(), pair.getValue()));

httpGet.setURI(uribe.build());
httpGet.setHeader("Accept", "application/json");
HttpResponse response = client.execute(httpGet);
HttpEntity entity = response.getEntity();

logger.debug("GET request is {}", httpGet.getURI());
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
if (response.getStatusLine().getStatusCode() == 200) {
contents = EntityUtils.toString(entity);
}
EntityUtils.consume(entity);
Expand Down

0 comments on commit f9728d3

Please sign in to comment.