| 369 | // ── PUT ────────────────────────────────────────────────────────────────────── |
| 370 | |
| 371 | void 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 |
nothing calls this directly
no test coverage detected