| 682 | // ── Utility functions ──────────────────────────────────────────────────────── |
| 683 | |
| 684 | String WebDAVHandler::getRequestPath(WebServer& s) const { |
| 685 | String uri = s.uri(); |
| 686 | String decoded = WebServer::urlDecode(uri); |
| 687 | |
| 688 | // Normalize using FsHelpers |
| 689 | std::string normalized = FsHelpers::normalisePath(decoded.c_str()); |
| 690 | String result = normalized.c_str(); |
| 691 | |
| 692 | if (result.isEmpty()) return "/"; |
| 693 | if (!result.startsWith("/")) result = "/" + result; |
| 694 | |
| 695 | // Remove trailing slash unless root |
| 696 | if (result.length() > 1 && result.endsWith("/")) { |
| 697 | result = result.substring(0, result.length() - 1); |
| 698 | } |
| 699 | |
| 700 | return result; |
| 701 | } |
| 702 | |
| 703 | String WebDAVHandler::getDestinationPath(WebServer& s) const { |
| 704 | String dest = s.header("Destination"); |
nothing calls this directly
no test coverage detected