Need a standardized approach for converting between ZIM-paths and URLs
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
The main purpose of ZIMs has been to store scraped website data and ZIM format allows paths looking like webpage addresses (with or without the host component).
Various openzim and kiwix projects (zim-tools, zimit, libkiwix, etc) have to convert between URLs and ZIM-paths and vice versa however there doesn't seem to be a single agreed upon method of doing that. As a result for certain edge cases the implementations in different projects can differ, leading to bugs.
An example
Consider that a scraper processes https://example.com/data/ and encounters the following resources under that root URI
A1) abc/de?f=12/34/5678
A2) abc/de?f=12/34/78
X) xyz
If the shown URL strings are used as ZIM-paths verbatim (without any encoding), what should be the URLs for referring to those articles?
URL for accessing A1 via a ZIM reader (to be appended to the full URI prefix):
abc/de?f=12/34/5678?abc/de%3Ff=12/34/5678? (only?is URI-encoded)abc/de%3Ff=12%2F34%2F5678? (?and/s in the search component are URI encoded)
Relative URL for referring from A1 to A2:
?f=12/34/78?./de?f=12/34/78?../78?./de%3Ff=12%2F34%2F5678?
Relative URL for referring from A1 to X:
../xyz?../../../xyz?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the URL and ZIM-path handling in zim-tools, zimit, and libkiwix, starting with the A1, A2, and X examples in this issue. Establish one agreed rule for absolute and relative conversions, including encoding and path resolution, and document the expected results for each example.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100