Skip to content

Commit

Permalink
fix: receive admin/mod keys intead of parsing them
Browse files Browse the repository at this point in the history
  • Loading branch information
hackergrrl committed May 22, 2020
1 parent 70c86c4 commit 5c7cb7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ function Cabal (storage, key, opts) {
else {
if (Buffer.isBuffer(key)) key = key.toString('hex')
if (!key.startsWith('cabal://')) key = 'cabal://' + key
const uri = new URL(key)
this.key = sanitizeKey(key)
this.modKeys = uri.searchParams.getAll('mod')
this.adminKeys = uri.searchParams.getAll('admin')
this.modKeys = opts.modKeys || []
this.adminKeys = opts.adminKeys || []
}
if (!isHypercoreKey(this.key)) throw new Error('invalid cabal key')

Expand Down

0 comments on commit 5c7cb7a

Please sign in to comment.