YARN-2897. CrossOriginFilter needs more log statements (Mit Desai via jeagles)
This commit is contained in:
parent
8bf6f0b703
commit
a8ad1e8089
|
@ -209,6 +209,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
YARN-3086. Make NodeManager memory configurable in MiniYARNCluster.
|
YARN-3086. Make NodeManager memory configurable in MiniYARNCluster.
|
||||||
(Robert Metzger via ozawa)
|
(Robert Metzger via ozawa)
|
||||||
|
|
||||||
|
YARN-2897. CrossOriginFilter needs more log statements (Mit Desai via
|
||||||
|
jeagles)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -106,25 +106,43 @@ public class CrossOriginFilter implements Filter {
|
||||||
|
|
||||||
String originsList = encodeHeader(req.getHeader(ORIGIN));
|
String originsList = encodeHeader(req.getHeader(ORIGIN));
|
||||||
if (!isCrossOrigin(originsList)) {
|
if (!isCrossOrigin(originsList)) {
|
||||||
|
if(LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Header origin is null. Returning");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!areOriginsAllowed(originsList)) {
|
if (!areOriginsAllowed(originsList)) {
|
||||||
|
if(LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Header origins '" + originsList + "' not allowed. Returning");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String accessControlRequestMethod =
|
String accessControlRequestMethod =
|
||||||
req.getHeader(ACCESS_CONTROL_REQUEST_METHOD);
|
req.getHeader(ACCESS_CONTROL_REQUEST_METHOD);
|
||||||
if (!isMethodAllowed(accessControlRequestMethod)) {
|
if (!isMethodAllowed(accessControlRequestMethod)) {
|
||||||
|
if(LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Access control method '" + accessControlRequestMethod +
|
||||||
|
"' not allowed. Returning");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String accessControlRequestHeaders =
|
String accessControlRequestHeaders =
|
||||||
req.getHeader(ACCESS_CONTROL_REQUEST_HEADERS);
|
req.getHeader(ACCESS_CONTROL_REQUEST_HEADERS);
|
||||||
if (!areHeadersAllowed(accessControlRequestHeaders)) {
|
if (!areHeadersAllowed(accessControlRequestHeaders)) {
|
||||||
|
if(LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Access control headers '" + accessControlRequestHeaders +
|
||||||
|
"' not allowed. Returning");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Completed cross origin filter checks. Populating " +
|
||||||
|
"HttpServletResponse");
|
||||||
|
}
|
||||||
res.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN, originsList);
|
res.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN, originsList);
|
||||||
res.setHeader(ACCESS_CONTROL_ALLOW_CREDENTIALS, Boolean.TRUE.toString());
|
res.setHeader(ACCESS_CONTROL_ALLOW_CREDENTIALS, Boolean.TRUE.toString());
|
||||||
res.setHeader(ACCESS_CONTROL_ALLOW_METHODS, getAllowedMethodsHeader());
|
res.setHeader(ACCESS_CONTROL_ALLOW_METHODS, getAllowedMethodsHeader());
|
||||||
|
|
Loading…
Reference in New Issue