Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-ladybugs-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fireworkers': patch
---

fix: support document IDs that contain hashes
7 changes: 6 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export const get_firestore_endpoint = (
const allPaths = ['v1', 'projects', project_id, 'databases', '(default)', 'documents', ...paths];
const path = allPaths.join('/') + suffix;

const endpoint = new URL(path, FIRESTORE_ENDPOINT);
const endpoint = new URL(FIRESTORE_ENDPOINT);

// We assign the pathname after instanciating the URL to ensure any hashes are encoded as part of the patname.
// This is done to support use cases where users have hashes in their document IDs.
endpoint.pathname = path;

return endpoint;
};