Skip to content

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Nov 24, 2025

  • Move href resolving logic to a separate method resolveHref
  • Add unit tests for resolveHref in ResponseParserTest

- Move href resolving logic to a separate method `resolveHref`
- Add unit tests for `resolveHref` in `ResponseParserTest`
@rfc2822 rfc2822 linked an issue Nov 24, 2025 that may be closed by this pull request
@rfc2822 rfc2822 added the refactoring Internal improvement of existing functions label Nov 24, 2025
@rfc2822 rfc2822 self-assigned this Nov 24, 2025
@rfc2822 rfc2822 requested a review from Copilot November 24, 2025 13:34
@rfc2822 rfc2822 marked this pull request as ready for review November 24, 2025 13:36
Copilot finished reviewing on behalf of rfc2822 November 24, 2025 13:37
Copy link
Contributor

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

This PR extracts the href resolving logic from the parseResponse method into a separate resolveHref method to improve testability and maintainability. The refactoring also adds error handling for URL parsing exceptions.

  • Extracted href resolution logic to a dedicated resolveHref method marked with @VisibleForTesting
  • Added exception handling for URLParserException with logging
  • Created comprehensive unit tests covering absolute URLs, absolute paths, relative paths, and relative paths with colons

Reviewed changes

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

File Description
src/main/kotlin/at/bitfire/dav4jvm/ktor/ResponseParser.kt Extracted href resolving logic to resolveHref method; added error handling and logging for URL parsing failures
src/test/kotlin/at/bitfire/dav4jvm/ktor/ResponseParserTest.kt Added unit tests for the resolveHref method covering various URL formats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rfc2822 rfc2822 merged commit d1ba5b3 into main Nov 24, 2025
11 checks passed
@rfc2822 rfc2822 deleted the 132-responseparser-extract-href-resolving branch November 24, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResponseParser: extract href resolving

1 participant