Skip to content

Commit 63fe90c

Browse files
committed
Use url-safe base64 encoding for document IDs in prepare function
1 parent b9170e6 commit 63fe90c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def prepare(searchDoc: Union[SearchDoc, List[SearchDoc]]):
2525
jsonDocs.append(
2626
{
2727
"@search.action": "mergeOrUpload",
28-
"id": base64.b64encode(searchDoc.url.encode()).decode(),
28+
"id": base64.urlsafe_b64encode(searchDoc.url.encode()).decode().rstrip("="),
2929
"title": searchDoc.title,
3030
"excerpt": searchDoc.excerpt,
3131
"author": searchDoc.author,

0 commit comments

Comments
 (0)