Skip to content

Commit

Permalink
Escape hyphens in version ids #810 (#860)
Browse files Browse the repository at this point in the history
Hyphens are typically used by MinIO in version ids (these are uuids).
We need to escape them as they are not included in the path to load a document
after bcb9740
  • Loading branch information
fflorent authored Feb 20, 2024
1 parent d8048c3 commit af67664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/common/gristUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ export function buildUrlId(parts: UrlIdParts): string {
// may be in a docId (leaving just the hyphen, which is permitted). The limits
// could be loosened, but without much benefit.
const codedSnapshotId = encodeURIComponent(parts.snapshotId)
.replace(/[_.!~*'()]/g, ch => `_${ch.charCodeAt(0).toString(16).toUpperCase()}`)
.replace(/[_.!~*'()-]/g, ch => `_${ch.charCodeAt(0).toString(16).toUpperCase()}`)
.replace(/%/g, '_');
token = `${token}~v=${codedSnapshotId}`;
}
Expand Down

0 comments on commit af67664

Please sign in to comment.