Fix from_public_link: subdirectory installs and port TypeError#293
Open
ismakov-dh wants to merge 1 commit intoowncloud:masterfrom
Open
Fix from_public_link: subdirectory installs and port TypeError#293ismakov-dh wants to merge 1 commit intoowncloud:masterfrom
ismakov-dh wants to merge 1 commit intoowncloud:masterfrom
Conversation
from_public_link failed in two scenarios: - Subdirectory installs (e.g. https://example.com/owncloud/s/TOKEN) produced https://example.com as the base URL, losing the /owncloud webroot. The WebDAV path then pointed to the wrong location. - The port was concatenated as int instead of str (owncloud#290), raising TypeError on any URL with a non-default port. Now correctly extracts the webroot by stripping /index.php/s/TOKEN or /s/TOKEN from the path, handles both pretty and non-pretty URL formats, and converts port to str before concatenation. Adds unit tests covering: root/subpath installs, pretty/non-pretty URLs, port handling, and folder_password passthrough. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
from_public_linkhad two bugs:https://example.com/owncloud/s/TOKENproducedhttps://example.comas the base URL, losing the/owncloudwebroot. All subsequent WebDAV calls then hit the wrong path.from_public_linkwhen port is not 80 #290):public_link_components.portreturnsint, but was concatenated with":" +(string), raisingTypeErroron any URL with a non-default port. Introduced in 299a72c when the f-string was replaced with string concatenation.Fix
Extracts the webroot by stripping
/index.php/s/TOKENor/s/TOKENfrom the URL path. Handles all real-world formats:https://host/s/TOKENhttps://hosthttps://host/index.php/s/TOKENhttps://hosthttps://host/owncloud/s/TOKENhttps://host/owncloudhttps://host/owncloud/index.php/s/TOKENhttps://host/owncloudhttps://host:8443/owncloud/s/TOKENhttps://host:8443/owncloudTest plan
🤖 Generated with Claude Code