summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-10 16:35:54 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-10 16:35:54 +0200
commitb46ee83973cc6d755637423200ac15ad6846ece0 (patch)
tree8d78382b4f1c24cf48800666fde495f7016e5086 /src
parentd01ba586693d37ff7d21afda348669807762d6dd (diff)
Fixed URL encoding of plus characters
The Gemini specifications says to encode RFC3986's reserved characters in URLs, but that didn't apply to plus characters in the "canonical" form.
Diffstat (limited to 'src')
-rw-r--r--src/gmutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gmutil.c b/src/gmutil.c
index ee8f150a..e0792d69 100644
--- a/src/gmutil.c
+++ b/src/gmutil.c
@@ -658,14 +658,14 @@ const iString *canonicalUrl_String(const iString *d) {
658 /* This is done separately to avoid the copy if %3A is not present; it's rare. */ 658 /* This is done separately to avoid the copy if %3A is not present; it's rare. */
659 canon = copy_String(d); 659 canon = copy_String(d);
660 urlDecodePath_String(canon); 660 urlDecodePath_String(canon);
661 iString *dec = maybeUrlDecodeExclude_String(canon, "%/?:;#&= "); /* decode everything else in all parts */ 661 iString *dec = maybeUrlDecodeExclude_String(canon, "%/?:;#&+= "); /* decode everything else in all parts */
662 if (dec) { 662 if (dec) {
663 set_String(canon, dec); 663 set_String(canon, dec);
664 delete_String(dec); 664 delete_String(dec);
665 } 665 }
666 } 666 }
667 else { 667 else {
668 canon = maybeUrlDecodeExclude_String(d, "%/?:;#&= "); 668 canon = maybeUrlDecodeExclude_String(d, "%/?:;#&+= ");
669 } 669 }
670 /* `canon` may now be NULL if nothing was decoded. */ 670 /* `canon` may now be NULL if nothing was decoded. */
671 if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos || 671 if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos ||