Skip to content

Commit

Permalink
Prevent recursion when index.html is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jacodg committed Jul 9, 2024
1 parent 8ce0171 commit c8ede50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/nl/nn/testtool/web/AngularServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,16 @@ public String getRequestURI() {
RequestDispatcher requestDispatcher = request.getRequestDispatcher(webJarsRequestURI);
requestDispatcher.include(requestWrapper, response);
} catch(FileNotFoundException e) {
// Serve index.html when a resource is not found
includeWebJarAsset(request, response, true);
if (forceIndexHtml) {
// Prevent recursion when index.html is not found
throw e;
} else {
// Serve index.html when a resource is not found
includeWebJarAsset(request, response, true);
}
}
}

}

class BaseRewritingServletOutputStream extends ServletOutputStream {
Expand Down

0 comments on commit c8ede50

Please sign in to comment.