diff --git a/service/src/main/java/bio/terra/pipelines/app/controller/PublicApiController.java b/service/src/main/java/bio/terra/pipelines/app/controller/PublicApiController.java index 3e9fae0c..b5ef7c6b 100644 --- a/service/src/main/java/bio/terra/pipelines/app/controller/PublicApiController.java +++ b/service/src/main/java/bio/terra/pipelines/app/controller/PublicApiController.java @@ -54,14 +54,9 @@ public ResponseEntity getVersion() { private static final String CSP_HEADER_NAME = "Content-Security-Policy"; private static final String CSP_HEADER_CONTENTS = - "default-src 'self'; script-src 'self' 'unsafe-inline'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; connect-src 'self'; form-action 'none';"; + "script-src 'self' 'unsafe-inline'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; form-action 'none';"; - @GetMapping(value = "/") - public String index() { - return "redirect:/swagger-ui.html"; - } - - @GetMapping({"/index.html", "/swagger-ui.html"}) + @GetMapping({"/", "/index.html", "/swagger-ui.html"}) public String getSwagger(Model model, HttpServletResponse response) { response.setHeader(CSP_HEADER_NAME, CSP_HEADER_CONTENTS); diff --git a/service/src/test/java/bio/terra/pipelines/controller/PublicApiControllerTest.java b/service/src/test/java/bio/terra/pipelines/controller/PublicApiControllerTest.java index 75d277f1..4cd910c9 100644 --- a/service/src/test/java/bio/terra/pipelines/controller/PublicApiControllerTest.java +++ b/service/src/test/java/bio/terra/pipelines/controller/PublicApiControllerTest.java @@ -74,14 +74,9 @@ void testVersion() throws Exception { .andExpect(jsonPath("$.build").value(build)); } - @Test - void testIndex() throws Exception { - this.mockMvc.perform(get("/")).andExpect(status().is3xxRedirection()); - } - @Test void testGetSwagger() throws Exception { - var swaggerPaths = Set.of("/index.html", "/swagger-ui.html"); + var swaggerPaths = Set.of("/", "/index.html", "/swagger-ui.html"); for (var path : swaggerPaths) { this.mockMvc .perform(get(path))