Skip to content
Permalink
Browse files
a bit more details for debug
Signed-off-by: olivier lamy <olamy@apache.org>
  • Loading branch information
olamy committed Apr 25, 2017
1 parent 91cc467 commit c46c26948dffcba709c5106e4a7cb744e54d558a
Showing 1 changed file with 15 additions and 5 deletions.
@@ -239,16 +239,22 @@ private boolean checkSourceRequestHeader(final URL targetUrl, final HttpServletR
headerFound=true;
log.debug("Origin Header URL found: {}", originUrl);
if (!targetUrl.getProtocol().equals(originUrl.getProtocol())) {
log.warn("Origin Header Protocol does not match originUrl={}, targetUrl={}", originUrl, targetUrl);
log.warn("Origin Header Protocol does not match originUrl={}, targetUrl={}", //
originUrl.getProtocol(), //
targetUrl.getProtocol());
return false;
}
if (!targetUrl.getHost().equals(originUrl.getHost())) {
log.warn("Origin Header Host does not match originUrl={}, targetUrl={}",originUrl,targetUrl);
log.warn("Origin Header Host does not match originUrl='{}', targetUrl='{}'",
originUrl.getProtocol(), //
targetUrl.getProtocol());
return false;
}
int originPort = getPort(originUrl);
if (targetPort != originPort) {
log.warn("Origin Header Port does not match originUrl={}, targetUrl={}",originUrl,targetUrl);
log.warn("Origin Header Port does not match originUrl={}, targetUrl={}",
originUrl.getPort(),
targetUrl.getPort());
return false;
}
} catch (MalformedURLException ex) {
@@ -263,12 +269,16 @@ private boolean checkSourceRequestHeader(final URL targetUrl, final HttpServletR
headerFound=true;
log.debug("Referer Header URL found: {}",refererUrl);
if (!targetUrl.getHost().equals(refererUrl.getHost())) {
log.warn("Referer Header Host does not match refererUrl={}, targetUrl={}",refererUrl,targetUrl);
log.warn("Referer Header Host does not match refererUrl='{}', targetUrl='{}'", //
refererUrl.getHost(), //
targetUrl.getHost());
return false;
}
int refererPort = getPort(refererUrl);
if (targetPort != refererPort) {
log.warn("Referer Header Port does not match refererUrl={}, targetUrl={}",refererUrl,targetUrl);
log.warn("Referer Header Port does not match refererUrl={}, targetUrl={}", //
refererUrl.getPort(),
targetUrl.getPort());
return false;
}
} catch (MalformedURLException ex) {

0 comments on commit c46c269

Please sign in to comment.