Commit 10b6d142 by Deep Singh Committed by Ashutosh Mestry

ATLAS-4049: Few admin apis were not redirected to Active server in HA mode

parent 8801ba68
...@@ -109,7 +109,8 @@ public class ActiveServerFilter implements Filter { ...@@ -109,7 +109,8 @@ public class ActiveServerFilter implements Filter {
} }
} }
final String adminUriNotFiltered[] = { "/admin/export", "/admin/import", "/admin/importfile" }; final String adminUriNotFiltered[] = { "/admin/export", "/admin/import", "/admin/importfile", "/admin/audits",
"/admin/purge", "/admin/expimp/audit", "/admin/metrics", "/admin/server", "/admin/audit/" };
private boolean isFilteredURI(ServletRequest servletRequest) { private boolean isFilteredURI(ServletRequest servletRequest) {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String requestURI = httpServletRequest.getRequestURI(); String requestURI = httpServletRequest.getRequestURI();
......
...@@ -105,7 +105,9 @@ public class ActiveServerFilterTest { ...@@ -105,7 +105,9 @@ public class ActiveServerFilterTest {
@Test @Test
public void adminImportRequestsToPassiveServerShouldToActiveServerAddress() throws IOException, ServletException { public void adminImportRequestsToPassiveServerShouldToActiveServerAddress() throws IOException, ServletException {
String importExportUrls[] = {"api/admin/export", "api/admin/import", "api/admin/importfile"}; String importExportUrls[] = {"api/admin/export", "api/admin/import", "api/admin/importfile", "api/admin/audits",
"api/admin/purge", "api/admin/expimp/audit", "api/admin/metrics",
"api/admin/server/dummy_name", "api/admin/audit/dummy_guid/details"};
for (String partialUrl : importExportUrls) { for (String partialUrl : importExportUrls) {
when(serviceState.getState()).thenReturn(ServiceState.ServiceStateValue.PASSIVE); when(serviceState.getState()).thenReturn(ServiceState.ServiceStateValue.PASSIVE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment