MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / getRequestPath

Method getRequestPath

src/network/WebDAVHandler.cpp:684–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682// ── Utility functions ────────────────────────────────────────────────────────
683
684String 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
703String WebDAVHandler::getDestinationPath(WebServer& s) const {
704 String dest = s.header("Destination");

Callers

nothing calls this directly

Calls 2

normalisePathFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected