Skip to content

Canonical server address parser#186

Open
mpivchev wants to merge 1 commit into
mainfrom
url-fixes
Open

Canonical server address parser#186
mpivchev wants to merge 1 commit into
mainfrom
url-fixes

Conversation

@mpivchev
Copy link
Copy Markdown
Collaborator

@mpivchev mpivchev commented May 21, 2026

  • Remove obsolete routes as we can use NextcloudKit instead.
  • Use a canonical address parser to avoid potential issues with addresses with subpaths and not properly setup rewrite configs, which can cause addresses such as test.com/nextcloud/index.php/index.php. Fix #71: Server Path Prefix #150 is applied to all cases.

Potentially fixes:
#185
#171
#161
#146

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR removes obsolete networking routers in favor of NextcloudKit and introduces a canonical server address parser to normalize user-provided server URLs (e.g., preventing duplicated /index.php segments).

Changes:

  • Added canonicalServerComponents(from:) and migrated URL building to use it across networking and account setup.
  • Replaced custom /status.php request logic with NextcloudKit’s server status API.
  • Removed obsolete StatusRouter / OCSRouter and related OCS header helper.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
iOCNotes/Views/SettingsView.swift UI tweak to keep settings title inline.
iOCNotes/Store.swift Uses canonical server components to derive base URL for accounts.
iOCNotes.xcodeproj/project.pbxproj Removes deleted router files from project references/build phases.
Utils/UtilityExtensions.swift Adds canonical server URL parsing helper.
Networking/StatusRouter.swift Deletes obsolete status router code.
Networking/ServerStatus.swift Builds /status.php URL via canonical components (no router).
Networking/Router.swift Builds Notes API base URL via canonical components instead of string concat + asURL().
Networking/OCSRouter.swift Deletes obsolete OCS router code.
Networking/NoteSessionManager.swift Migrates status fetch to NextcloudKit async API.
Networking/HTTPHeader+Extensions.swift Removes OCS header helper no longer used.

Comment thread Utils/UtilityExtensions.swift
Comment thread Networking/Router.swift
Copy link
Copy Markdown
Collaborator

@i2h3 i2h3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting could be prettier and more comfortable to read but besides that it looks fine to me. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants