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

Function normalizeWebPath

src/network/CrossPointWebServer.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49unsigned long wsLastCompleteAt = 0;
50
51String normalizeWebPath(const String& inputPath) {
52 if (inputPath.isEmpty() || inputPath == "/") {
53 return "/";
54 }
55 std::string normalized = FsHelpers::normalisePath(inputPath.c_str());
56 String result = normalized.c_str();
57 if (result.isEmpty()) {
58 return "/";
59 }
60 if (!result.startsWith("/")) {
61 result = "/" + result;
62 }
63 if (result.length() > 1 && result.endsWith("/")) {
64 result = result.substring(0, result.length() - 1);
65 }
66 return result;
67}
68
69bool isProtectedItemName(const String& name) {
70 if (name.startsWith(".")) {

Callers 2

handleRenameMethod · 0.85
handleMoveMethod · 0.85

Calls 2

normalisePathFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected