aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Allen2025-07-17 11:14:45 -0700
committerEli Zaretskii2025-08-02 16:49:52 +0300
commit5140e317b75d0467bfbbabb5d12404568fee1bb7 (patch)
tree0c20b284c67f2e4aadb45ab7620d2941c6aff088 /test
parent5979d17ea94d5fbc1597821a36759f41eef1c282 (diff)
downloademacs-5140e317b75d0467bfbbabb5d12404568fee1bb7.tar.gz
emacs-5140e317b75d0467bfbbabb5d12404568fee1bb7.zip
url: %-encode literal % characters when building query strings
When building a query string via `url-build-query-string', %-encode literal % characters appearing in both the keys and the values. * lisp/url/url-util.el (url--query-key-value-preserved-chars): Define a new constant based on `url-query-key-value-allowed-chars' specifying the characters that should be preserved when %-encoding query-string keys and values. (url-build-query-string): Use the new constant (fixes Bug#78984). * test/lisp/url/url-util-tests.el (url-util-tests): Add a test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/url/url-util-tests.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lisp/url/url-util-tests.el b/test/lisp/url/url-util-tests.el
index d34bfc8509c..6e79a798333 100644
--- a/test/lisp/url/url-util-tests.el
+++ b/test/lisp/url/url-util-tests.el
@@ -33,10 +33,10 @@
33 ((key1 "val1") (key2 val2) (key3 val1 val2) ("key4") (key5 "")) t) 33 ((key1 "val1") (key2 val2) (key3 val1 val2) ("key4") (key5 "")) t)
34 ("key1=val1;key2=val2;key3=val1;key3=val2;key4=;key5=" 34 ("key1=val1;key2=val2;key3=val1;key3=val2;key4=;key5="
35 ((key1 val1) (key2 val2) ("key3" val1 val2) (key4) (key5 "")) t t) 35 ((key1 val1) (key2 val2) ("key3" val1 val2) (key4) (key5 "")) t t)
36 ("key1=val/slash;key2=val%3Bsemi;key3=val%26amp;key4=val%3Deq" 36 ("key1=val/slash;key2=val%3Bsemi;key3=val%26amp;key4=val%3Deq;key5=val%25perc"
37 ((key1 "val/slash") (key2 "val;semi") (key3 "val&amp") (key4 "val=eq")) t) 37 ((key1 "val/slash") (key2 "val;semi") (key3 "val&amp") (key4 "val=eq") (key5 "val%perc")) t)
38 ("key%3Deq=val1;key%3Bsemi=val2;key%26amp=val3" 38 ("key%3Deq=val1;key%3Bsemi=val2;key%26amp=val3;key%25perc=val4"
39 (("key=eq" val1) ("key;semi" val2) ("key&amp" val3)) t))) 39 (("key=eq" val1) ("key;semi" val2) ("key&amp" val3) ("key%perc" val4)) t)))
40 test) 40 test)
41 (while tests 41 (while tests
42 (setq test (car tests) 42 (setq test (car tests)