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

Method handlePut

src/network/WebDAVHandler.cpp:371–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369// ── PUT ──────────────────────────────────────────────────────────────────────
370
371void WebDAVHandler::handlePut(WebServer& s) {
372 // Body was already received via canRaw/raw callbacks
373 String path = getRequestPath(s);
374 LOG_DBG("DAV", "PUT %s", path.c_str());
375
376 if (isProtectedPath(path)) {
377 s.send(403, "text/plain", "Forbidden");
378 return;
379 }
380
381 if (!_putOk) {
382 String tempPath = path + ".davtmp";
383 Storage.remove(tempPath.c_str());
384 s.send(500, "text/plain", "Write failed - incomplete upload or disk full");
385 return;
386 }
387
388 clearBookCache(path.c_str());
389 s.send(_putExisted ? 204 : 201);
390 LOG_DBG("DAV", "PUT complete: %s", path.c_str());
391}
392
393// ── DELETE ───────────────────────────────────────────────────────────────────
394

Callers

nothing calls this directly

Calls 2

clearBookCacheFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected