From dc37be3b605287be6f997a945bfc31da4ffc1e73 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 27 Apr 2023 14:28:19 +0200 Subject: [PATCH] [uri] Encode only bytes with highest bit set. Refs #226 It is not good, but before it was worse. Characters like ? and = were encoded. --- src/protocol/uri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 1e9c08c6..6ee4af65 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -1434,7 +1434,7 @@ encode_uri_string_percent(struct string *string, const char *name, int namelen) if (namelen < 0) namelen = strlen(name); for (end = name + namelen; name < end; name++) { - if (safe_char(*name) || (*name == '/') || (*name == '%')) { + if ((unsigned char)(*name) < 128) { add_char_to_string(string, *name); } else { /* Hex it. */