diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-30 08:20:38 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-30 08:20:38 +0300 |
commit | 73a721fc93c3be7b13361dea41d4431ad14a3fdd (patch) | |
tree | e6de1687d1932509789e21ed4232fe2c6def32ad /src/gmdocument.c | |
parent | 42d461f32eb77a83c0f9d7b4fb202de72c64a97f (diff) |
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.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index f15d9d1d..8832271a 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -1554,13 +1554,14 @@ static void normalize_GmDocument(iGmDocument *d) { | |||
1554 | printf("wasNormalized: %d\n", wasNormalized); | 1554 | printf("wasNormalized: %d\n", wasNormalized); |
1555 | fflush(stdout); | 1555 | fflush(stdout); |
1556 | set_String(&d->source, collect_String(normalized)); | 1556 | set_String(&d->source, collect_String(normalized)); |
1557 | normalize_String(&d->source); /* NFC */ | 1557 | //normalize_String(&d->source); /* NFC */ |
1558 | printf("orig:%zu norm:%zu\n", size_String(&d->unormSource), size_String(&d->source)); | 1558 | printf("orig:%zu norm:%zu\n", size_String(&d->unormSource), size_String(&d->source)); |
1559 | /* normalized source has an extra newline at the end */ | 1559 | /* normalized source has an extra newline at the end */ |
1560 | // iAssert(wasNormalized || equal_String(&d->unormSource, &d->source)); | 1560 | // iAssert(wasNormalized || equal_String(&d->unormSource, &d->source)); |
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | void setUrl_GmDocument(iGmDocument *d, const iString *url) { | 1563 | void setUrl_GmDocument(iGmDocument *d, const iString *url) { |
1564 | url = canonicalUrl_String(url); | ||
1564 | set_String(&d->url, url); | 1565 | set_String(&d->url, url); |
1565 | iUrl parts; | 1566 | iUrl parts; |
1566 | init_Url(&parts, url); | 1567 | init_Url(&parts, url); |