From 73a721fc93c3be7b13361dea41d4431ad14a3fdd Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 30 Jun 2021 08:20:38 +0300 Subject: Canonical URIs Internally, all URIs should be converted to a canonical form so that they can be compared against each other. The canonical form is an IRI with spaces and reserved characters percent-encoded. --- src/gempub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gempub.c') diff --git a/src/gempub.c b/src/gempub.c index 1f5d58ce..23846414 100644 --- a/src/gempub.c +++ b/src/gempub.c @@ -246,10 +246,10 @@ size_t navSize_Gempub(const iGempub *d) { size_t navIndex_Gempub(const iGempub *d, const iString *url) { parseNavigationLinks_Gempub_(d); - const iString *normUrl = withSpacesEncoded_String(url); + const iString *canonUrl = withSpacesEncoded_String(url); iConstForEach(Array, i, d->navLinks) { const iGempubNavLink *nav = i.value; - if (equalCase_String(&nav->url, normUrl)) { + if (equalCase_String(&nav->url, canonUrl)) { return index_ArrayConstIterator(&i); } } -- cgit v1.2.3