Skip to content

Conversation

@mickael-menu
Copy link
Member

Instead of comparing URL to their string representation, compare their components with different rules:

  • Scheme is case insensitive.
  • Paths must be compared percent-decoded.
  • Authority, fragment and query parameters must match.

The reason for this change is that some EPUBs encode unreserved characters which breaks locating a Link from an HREF.

For example both of these are valid relative URLs which point to the same resource:

  • Text/Ces_choses_qu'on_laisse.xhtml
  • Text/Ces_choses_qu%27on_laisse.xhtml

@mickael-menu mickael-menu merged commit 91bc159 into develop Jun 11, 2024
@mickael-menu mickael-menu deleted the fix/url-equality branch June 11, 2024 14:52
mickael-menu added a commit to demarque/readium-swift-toolkit that referenced this pull request Jun 11, 2024
mickael-menu added a commit that referenced this pull request Jun 12, 2024
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.

2 participants