This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch cherry-pick-more-for-3.4.3
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 71995b925eb7b2525e0e4647ef1060c4db6ab2ab
Author: Robert Newson <rnew...@apache.org>
AuthorDate: Thu Mar 6 14:03:42 2025 +0000

    nouveau: base64 only takes binaries
    
    jiffy may return an iolist butbase64:encode() cannot take iolists as
    input. since we also want urlsafe encoding we switch base64:encode to
    b64url:encode/1 as it will accept iolists. this matches dreyfus behaviour 
too.
    
    closes #5453
---
 src/nouveau/src/nouveau_bookmark.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nouveau/src/nouveau_bookmark.erl 
b/src/nouveau/src/nouveau_bookmark.erl
index b919534ea..08aeb0f73 100644
--- a/src/nouveau/src/nouveau_bookmark.erl
+++ b/src/nouveau/src/nouveau_bookmark.erl
@@ -50,7 +50,7 @@ unpack(_DbName, Empty) when Empty == undefined; Empty == nil; 
Empty == null ->
 unpack(DbName, PackedBookmark) when is_list(PackedBookmark) ->
     unpack(DbName, list_to_binary(PackedBookmark));
 unpack(DbName, PackedBookmark) when is_binary(PackedBookmark) ->
-    Bookmark = jiffy:decode(base64:decode(PackedBookmark), [return_maps]),
+    Bookmark = jiffy:decode(b64url:decode(PackedBookmark), [return_maps]),
     maps:from_list([{range_of(DbName, V), V} || V <- Bookmark]).
 
 pack(nil) ->
@@ -58,7 +58,7 @@ pack(nil) ->
 pack({EJson}) when is_list(EJson) ->
     pack(from_ejson(EJson));
 pack(UnpackedBookmark) when is_map(UnpackedBookmark) ->
-    base64:encode(jiffy:encode(maps:values(UnpackedBookmark))).
+    b64url:encode(jiffy:encode(maps:values(UnpackedBookmark))).
 
 %% legacy use of ejson within mango
 from_ejson({Props}) ->

Reply via email to