fix(terabox): normalize empty dir to / for dm domain API - #9630
Open
FahadBinHussain wants to merge 1 commit into
Open
fix(terabox): normalize empty dir to / for dm domain API#9630FahadBinHussain wants to merge 1 commit into
FahadBinHussain wants to merge 1 commit into
Conversation
TeraBox migrated its API from www.terabox.com to dm.terabox.com. The driver's redirect handler (errno -6 -> Url-Domain-Prefix header) already handles the domain migration, but the new dm API rejects an empty dir param with errno: 2 (invalid path). When listing the storage root, the driver's List() passes an empty dir string (since the root object's path within the storage is empty). The old www.terabox.com API tolerated this, but dm.terabox.com requires dir=/ for the root. Fix: normalize empty dir to / in getFiles() before making the API call. This is a one-line change.
FahadBinHussain
force-pushed
the
fix/terabox-empty-dir-dm-api
branch
from
August 24, 2026 06:00
e7d1e2d to
4145602
Compare
okatu-loli
approved these changes
Aug 25, 2026
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.
TeraBox migrated its API from \www.terabox.com\ to \dm.terabox.com. The driver already has a redirect handler (errno -6 -> \Url-Domain-Prefix\ header) that switches base_url to the dm domain, but the new dm API rejects an empty \dir\ param with \�rrno: 2.
When listing the storage root, \List()\ passes an empty dir string (the root object's path within the storage is empty). The old \www.terabox.com\ API tolerated this; \dm.terabox.com\ requires \dir=/.
This one-line fix normalizes empty dir to /\ in \getFiles()\ before the API call. Without it, listing the root returns 0 files, which also breaks WebDAV MKCOL+PUT (parent dir lookup fails).
Tested against a live TeraBox account: after the fix, \s/list\ returns the real files and WebDAV upload works.