You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2020/12/15 09:21:08 UTC

svn commit: r1884450 - in /httpd/httpd/branches/2.4.x: ./ changes-entries/pr57044.txt modules/metadata/mod_unique_id.c

Author: jorton
Date: Tue Dec 15 09:21:08 2020
New Revision: 1884450

URL: http://svn.apache.org/viewvc?rev=1884450&view=rev
Log:
Merge r1883947 from trunk:

* 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

Added:
    httpd/httpd/branches/2.4.x/changes-entries/pr57044.txt
      - copied unchanged from r1883947, httpd/httpd/trunk/changes-entries/pr57044.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/modules/metadata/mod_unique_id.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1883947

Modified: httpd/httpd/branches/2.4.x/modules/metadata/mod_unique_id.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/metadata/mod_unique_id.c?rev=1884450&r1=1884449&r2=1884450&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/metadata/mod_unique_id.c (original)
+++ httpd/httpd/branches/2.4.x/modules/metadata/mod_unique_id.c Tue Dec 15 09:21:08 2020
@@ -172,17 +172,14 @@ static void unique_id_child_init(apr_poo
                              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)