HADOOP-13693. Remove the message about HTTP OPTIONS in SPNEGO initialization message from kms audit log.

This commit is contained in:
Xiao Chen 2016-10-18 18:24:37 -07:00
parent efdf810cf9
commit d75cbc5749
1 changed files with 7 additions and 3 deletions

View File

@ -145,9 +145,13 @@ public void doFilter(ServletRequest request, ServletResponse response,
requestURL.append("?").append(queryString);
}
KMSWebApp.getKMSAudit().unauthenticated(
request.getRemoteHost(), method, requestURL.toString(),
kmsResponse.msg);
if (!method.equals("OPTIONS")) {
// an HTTP OPTIONS request is made as part of the SPNEGO authentication
// sequence. We do not need to audit log it, since it doesn't belong
// to KMS context. KMS server doesn't handle OPTIONS either.
KMSWebApp.getKMSAudit().unauthenticated(request.getRemoteHost(), method,
requestURL.toString(), kmsResponse.msg);
}
}
}