git ssb

3+

cel / ssb-npm-registry



Commit 9bc172fc9883a9eb2fa1ceee027cc37daadcc6e6

Handle bad mention names

cel committed on 1/20/2018, 12:35:56 AM
Parent: 14251d504418198fd278622cc498a5aff135d7d9

Files changed

index.jschanged
index.jsView
@@ -224,8 +224,9 @@
224224 function packageLinks(sbot, feed, id, name, spec) {
225225 function matches(mention) {
226226 var data = mention
227227 && mention.link === id
228+ && mention.name
228229 && decodeName(mention.name)
229230 return data
230231 && data.name === name
231232 && (spec ? semver.satisfies(data.version, spec) : true)
@@ -636,9 +637,9 @@
636637 this.respond(this.req.method === 'PUT' ? 201 : 200, {token: '1'})
637638 }
638639
639640 function decodeName(name) {
640- var parts = name.replace(/\.tgz$/, '').split(':')
641+ var parts = String(name).replace(/\.tgz$/, '').split(':')
641642 return {
642643 name: parts[1],
643644 version: parts[2],
644645 distTag: parts[3],

Built with git-ssb-web