# HG changeset patch # User Evgeniy.Koshkin # Date 1393421153 -14400 # Node ID cee56ab3c315e8387782453f6f3e3f7c0bc5efb6 # Parent 8fcb224ce39410dac35713433896433ff5a5325b fixed "java.lang.StringIndexOutOfBoundsException: String index out of range: -2" while processing requests on url's with double slaches (e.g. '/app/symbols//index2.txt') diff -r 8fcb224ce394 -r cee56ab3c315 server-tests/src/DownloadSymbolsControllerTest.java --- a/server-tests/src/DownloadSymbolsControllerTest.java Wed Feb 26 16:15:18 2014 +0400 +++ b/server-tests/src/DownloadSymbolsControllerTest.java Wed Feb 26 17:25:53 2014 +0400 @@ -66,6 +66,13 @@ } @Test + public void request_pdb_two_slashes_in_url() throws Exception { + myRequest.setRequestURI("mock", "/app/symbols//index2.txt'"); + doGet(); + assertEquals(HttpStatus.SC_NOT_FOUND, myResponse.getStatus()); + } + + @Test public void request_pdb_invalid_url() throws Exception { myRequest.setRequestURI("mock", "/app/symbols/foo"); doGet(); diff -r 8fcb224ce394 -r cee56ab3c315 server/src/jetbrains/buildServer/symbols/DownloadSymbolsController.java --- a/server/src/jetbrains/buildServer/symbols/DownloadSymbolsController.java Wed Feb 26 16:15:18 2014 +0400 +++ b/server/src/jetbrains/buildServer/symbols/DownloadSymbolsController.java Wed Feb 26 17:25:53 2014 +0400 @@ -60,7 +60,7 @@ @Nullable @Override protected ModelAndView doHandle(final @NotNull HttpServletRequest request, final @NotNull HttpServletResponse response) throws Exception { - final String requestURI = request.getRequestURI(); + final String requestURI = request.getRequestURI().replace("//", "/"); if(requestURI.endsWith(SymbolsConstants.APP_SYMBOLS)){ response.sendError(HttpServletResponse.SC_OK, "TeamCity Symbol Server available");