HADOOP-14915. method name is incorrect in ConfServlet. Contributed by Bharat Viswanadham.
(cherry picked from commit 563dcdfc1d
)
This commit is contained in:
parent
0b3e3e4895
commit
af52a585f0
|
@ -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;
|
||||
|
|
|
@ -98,7 +98,7 @@ public class TestConfServlet {
|
|||
Mockito.when(request.getHeader(HttpHeaders.ACCEPT))
|
||||
.thenReturn(contentTypeExpected);
|
||||
assertEquals(contenTypeActual,
|
||||
ConfServlet.parseAccecptHeader(request));
|
||||
ConfServlet.parseAcceptHeader(request));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue