From b5037c2a71bc684bf56742f515994b0ab7a8447a Mon Sep 17 00:00:00 2001 From: C-3PO Date: Mon, 9 Jul 2018 16:06:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=20Fix=20checking=20of=20announce=20ur?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/verify/verifySolidpkg.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ssn/verify/verifySolidpkg.ts b/src/ssn/verify/verifySolidpkg.ts index cfa60c3..268f2b8 100644 --- a/src/ssn/verify/verifySolidpkg.ts +++ b/src/ssn/verify/verifySolidpkg.ts @@ -5,13 +5,12 @@ export default function verifySolidpkg(file: ISolid, { product, from, to }: {pro if (typeof file['creation date'] !== 'number') { throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`); } + //used by most .solidpkg files const announceGeneral = /^http:\/\/Tracker22\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.(tel\.swtor\.com|ssntracker\.int):80\/$/; + //used by retailclient_swtor_-1to0 const announceRetailclientSwtor = /^http:\/\/Tracker14\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.snxd\.com:2500\/$/; - if (file.announce.match(announceGeneral) === null && product !== 'retailclient_swtor') { - throw new Error(`Expected general announce URL but it was "${file.announce}".`); - } - if (file.announce.match(announceRetailclientSwtor) === null && product === 'retailclient_swtor') { - throw new Error(`Expected retailclient announce URL but it was "${file.announce}".`); + if (file.announce.match(announceGeneral) === null && file.announce.match(announceRetailclientSwtor) === null) { + throw new Error(`Expected announce URL but it was "${file.announce}".`); } if (file.title !== `${product}: ${from}to${to}`) { throw new Error(`Expected title "${product}: ${from}to${to}" but it was "${file.title}".`);