[_]: fix/add-webdav-rfc-fixes - #677
Merged
Merged
Conversation
… RangeNotSatisfiableError
…ending 404 response
…y in DELETE and PUT handlers
…o optimize resource usage
…and implement PROPPATCH request handling
…tent length check
…process termination
larryrider
marked this pull request as ready for review
September 8, 2026 10:30
xabg2
approved these changes
Sep 8, 2026
larryrider
force-pushed
the
fix/add-webdav-rfc-fixes
branch
from
September 9, 2026 17:59
667b6ef to
eac8356
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This branch fixes a batch of WebDAV RFC 4918 (and RFC 7233 Range-Request) compliance issues found while auditing the CLI's WebDAV server, plus a few unrelated reliability fixes for the Docker deployment.
RFC / protocol compliance fixes:
201 Createdwhen locking a not-yet-existing resource (lock-null resource per RFC 4918 9.10.1),200 OKwhen locking an existing one, previously always returned200.Overwriteheader (RFC 4918 10.6). Defaults toT, whenFand the destination already exists, respond412 Precondition Failedinstead of silently overwriting. When overwriting is allowed, return204(existing destination replaced) vs201(new destination created), matching the same replace-vs-create pattern already used inPUT.NotFoundErrorfor missing resources instead of manually sending a raw404, so it goes through the shared error-handling middleware like every other handler.PROPPATCHin theAllowheader and implement an actual PROPPATCH handler (previously unimplemented), needed by clients (e.g. Synology Hyper Backup) that probe support before writing.RangeNotSatisfiableError(416) and reworkedparseRangeHeaderto throwBadRequestError(400) for malformed ranges instead of generic errors, and addedContent-Rangeheader support onHEAD.req.destroy()the connection when the client hasn't finished sending the request body (e.g. a large PUT rejected early by a size check). Trivial errors (404,409,415...) now let the response flush normally so keep-alive connections can be reused instead of being reset on every error.DriveItemRepositorydeletion that both handlers were doing unnecessarily.DriveFileService.replaceFile(in-place metadata update) instead of only whencontentLength > 0. For empty/0-byte files (common in WebDAV lock/keep-alive control files written by backup clients like Hyper Backup), the previous delete-then-recreate path raced with backend propagation and could return409 File already existson a legitimate overwrite.Other fixes (not RFC-related, found triaging support tickets on this branch):
getFolderContent: fetch a folder's subfolders and subfiles concurrently (Promise.all) instead of sequentially, halves the round-trips for large folder listings (e.g.PROPFIND /on accounts with many small backup-generated files).session_alivekeepalive check: compare the logged-in email case-insensitively.login-legacynormalizes the email to lowercase server-side, so anINXT_USERenv var with any uppercase character made the keepalive loop think the session was always expired, forcing a full re-login (and WebDAV server restart) roughly every 30s, even when idle.unhandledRejectionguard added to both CLI entrypoints (bin/run.js,bin/dev.js), mirroring the existinguncaughtExceptionguard in the WebDAV server. A stream-cleanup race inside@internxt/inxt-js's upload pipeline can reject an orphaned promise withAbortError/ABORT_ERRoutside of our own try/catch, previously this crashed the whole process (defeatingupload-folder's per-file retry/skip logic), now it's logged and the command keeps going.