Skip to content
Snippets Groups Projects
Commit d6199d21 authored by Gaelle.Barris's avatar Gaelle.Barris
Browse files

Ajout logs

parent 68dc677b
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
</parent>
<groupId>fr.gouv.siig.descartes</groupId>
<artifactId>services</artifactId>
<version>0.0.20</version>
<version>0.0.21</version>
<packaging>war</packaging>
<name>Descartes - Module D-WsMap</name>
<description>Services web de Descartes</description>
......
......@@ -262,16 +262,20 @@ public class HttpSender {
return result;
}
private static boolean hasProxy(String globalURL, HttpProxy httpProxy) throws HttpSenderException {
private static boolean hasProxy(String globalURL, HttpProxy httpProxy) throws HttpSenderException {
boolean proxy = false;
if (httpProxy != null && httpProxy.getHost() != null && httpProxy.getPort()!=0) {
if (httpProxy != null && httpProxy.getHost() != null && !httpProxy.getHost().equalsIgnoreCase("") && httpProxy.getPort()!=0) {
proxy = true;
LOGGER.debug("***** DESCARTES HttpSender hasProxy urlName: " + globalURL);
try {
if (httpProxy.getUrlExceptions() != null) {
URL url = new URL(globalURL);
if (httpProxy.getUrlExceptions() != null && !httpProxy.getUrlExceptions().equalsIgnoreCase("")) {
LOGGER.debug("***** DESCARTES HttpSender hasProxy httpProxy.getUrlExceptions(): " + httpProxy.getUrlExceptions());
URL url = new URL(globalURL);
String host = url.getHost();
LOGGER.debug("***** DESCARTES HttpSender hasProxy host: " + host);
String[] noProxyURLs = httpProxy.getUrlExceptions().split(";");
for (String noProxyURL : noProxyURLs) {
LOGGER.debug("***** DESCARTES HttpSender hasProxy noProxyURL: " + noProxyURL);
if (host.startsWith(noProxyURL) || host.endsWith(noProxyURL)) {
proxy = false;
break;
......@@ -279,9 +283,11 @@ public class HttpSender {
}
}
} catch (MalformedURLException e) {
throw new HttpSenderException("URL non valide" + globalURL,e);
LOGGER.debug("***** DESCARTES HttpSender hasProxy MalformedURLException: " + globalURL, e);
throw new HttpSenderException("URL non valide : " + globalURL,e);
}
}
LOGGER.debug("***** DESCARTES HttpSender hasProxy Proxy config: " + proxy);
return proxy;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment