Skip to content

Commit

Permalink
fix: ensure slashes aren't part of topics
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Nov 30, 2023
1 parent 01757fb commit b4836df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Invitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class InvitationV1 implements invitation.InvitationV1 {
.replace(/=*$/g, '')
// Replace slashes with dashes so that the topic is still easily split by /
// We do not treat this as needing to be valid Base64 anywhere
.replace('/', '-')
.replace(/\//g, '-')
)
const keyMaterial = crypto.getRandomValues(new Uint8Array(32))

Expand Down
2 changes: 1 addition & 1 deletion test/utils/topic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('topic utils', () => {
.replace(/=*$/g, '')
// Replace slashes with dashes so that the topic is still easily split by /
// We do not treat this as needing to be valid Base64 anywhere
.replace('/', '-')
.replace(/\//g, '-')
)
)

Expand Down

0 comments on commit b4836df

Please sign in to comment.