(HttpServletRequest req, HttpServletResponse resp)
| 587 | |
| 588 | |
| 589 | @Override |
| 590 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
| 591 | |
| 592 | final String path = getRelativePath(req); |
| 593 | |
| 594 | // Error page check needs to come before special path check since |
| 595 | // custom error pages are often located below WEB-INF so they are |
| 596 | // not directly accessible. |
| 597 | if (req.getDispatcherType() == DispatcherType.ERROR) { |
| 598 | doGet(req, resp); |
| 599 | return; |
| 600 | } |
| 601 | |
| 602 | // Block access to special subdirectories. |
| 603 | // DefaultServlet assumes it services resources from the root of the web app |
| 604 | // and doesn't add any special path protection |
| 605 | // WebdavServlet remounts the webapp under a new path, so this check is |
| 606 | // necessary on all methods (including GET). |
| 607 | if (isSpecialPath(path)) { |
| 608 | resp.sendError(WebdavStatus.SC_NOT_FOUND); |
| 609 | return; |
| 610 | } |
| 611 | |
| 612 | final String method = req.getMethod(); |
| 613 | |
| 614 | if (debug > 0) { |
| 615 | log("[" + method + "] " + path); |
| 616 | } |
| 617 | |
| 618 | switch (method) { |
| 619 | case Method.PROPFIND -> doPropfind(req, resp); |
| 620 | case Method.PROPPATCH -> doProppatch(req, resp); |
| 621 | case Method.MKCOL -> doMkcol(req, resp); |
| 622 | case Method.COPY -> doCopy(req, resp); |
| 623 | case Method.MOVE -> doMove(req, resp); |
| 624 | case Method.LOCK -> doLock(req, resp); |
| 625 | case Method.UNLOCK -> doUnlock(req, resp); |
| 626 | // DefaultServlet processing |
| 627 | default -> super.service(req, resp); |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | |
| 632 | @Override |
nothing calls this directly
no test coverage detected