readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
222 stars 96 forks source link

Normalize URLs on-the-fly when comparing #454

Closed mickael-menu closed 2 weeks ago

mickael-menu commented 2 weeks ago

Normalize URLs on-the-fly when comparing

Normalize URLs when comparing them following these rules:

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:

URL and Media type in Link and Locator objects

Locator and Link objects now use AnyURL and MediaType instead of strings.