HADOOP-14915. method name is incorrect in ConfServlet. Contributed by Bharat Viswanadham.
This commit is contained in:
parent
06df6ab254
commit
563dcdfc1d
@ -69,7 +69,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
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 void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
}
|
||||
|
||||
@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;
|
||||
|
@ -98,7 +98,7 @@ public void testParseHeaders() throws Exception {
|
||||
Mockito.when(request.getHeader(HttpHeaders.ACCEPT))
|
||||
.thenReturn(contentTypeExpected);
|
||||
assertEquals(contenTypeActual,
|
||||
ConfServlet.parseAccecptHeader(request));
|
||||
ConfServlet.parseAcceptHeader(request));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user