]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1883947 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 15 Dec 2020 09:21:08 +0000 (09:21 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 15 Dec 2020 09:21:08 +0000 (09:21 +0000)
* modules/metadata/mod_unique_id.c: Use base64url encoding for
  uuencoder table.

PR: 57044
Submitted by: Michael Kaufmann <apache-bugzilla michael-kaufmann.ch>
Reviewed by: jorton, ylavic, covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1884450 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/pr57044.txt [new file with mode: 0644]
modules/metadata/mod_unique_id.c

diff --git a/changes-entries/pr57044.txt b/changes-entries/pr57044.txt
new file mode 100644 (file)
index 0000000..3d2d32c
--- /dev/null
@@ -0,0 +1,3 @@
+  *) mod_unique_id: Use base64url encoding for UNIQUE_ID variable,
+     avoiding the use of '@'.  PR 57044.
+     [Michael Kaufmann <apache-bugzilla michael-kaufmann.ch>]
index 173cbf52d8eac1da0d66e5d35b0a40b75c465608..4a92beaefb8e3cd90706989460019762381af031 100644 (file)
@@ -172,17 +172,14 @@ static void unique_id_child_init(apr_pool_t *p, server_rec *s)
                              sizeof(cur_unique_id.counter));
 }
 
-/* NOTE: This is *NOT* the same encoding used by base64encode ... the last two
- * characters should be + and /.  But those two characters have very special
- * meanings in URLs, and we want to make it easy to use identifiers in
- * URLs.  So we replace them with @ and -.
- */
+/* Use the base64url encoding per RFC 4648, avoiding characters which
+ * are not safe in URLs.  ### TODO: can switch to apr_encode_*. */
 static const char uuencoder[64] = {
     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
     'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
     'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
-    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@', '-',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
 };
 
 static const char *gen_unique_id(const request_rec *r)