HADOOP-14915. method name is incorrect in ConfServlet. Contributed by Bharat Viswanadham.

This commit is contained in:
Chen Liang 2017-10-02 10:58:19 -07:00
parent 06df6ab254
commit 563dcdfc1d
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ public class ConfServlet extends HttpServlet {
return;
}
String format = parseAccecptHeader(request);
String format = parseAcceptHeader(request);
if (FORMAT_XML.equals(format)) {
response.setContentType("text/xml; charset=utf-8");
} else if (FORMAT_JSON.equals(format)) {
@ -89,7 +89,7 @@ public class ConfServlet extends HttpServlet {
}
@VisibleForTesting
static String parseAccecptHeader(HttpServletRequest request) {
static String parseAcceptHeader(HttpServletRequest request) {
String format = request.getHeader(HttpHeaders.ACCEPT);
return format != null && format.contains(FORMAT_JSON) ?
FORMAT_JSON : FORMAT_XML;

View File

@ -98,7 +98,7 @@ public class TestConfServlet {
Mockito.when(request.getHeader(HttpHeaders.ACCEPT))
.thenReturn(contentTypeExpected);
assertEquals(contenTypeActual,
ConfServlet.parseAccecptHeader(request));
ConfServlet.parseAcceptHeader(request));
}
}