Fix signup and import
This commit is contained in:
parent
71ba1ead4f
commit
7243393272
|
@ -237,7 +237,8 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express.
|
|||
torrentfile.path = newTorrentPath
|
||||
|
||||
const buf = await readFile(torrentfile.path)
|
||||
const parsedTorrent = parseTorrent(buf) as Instance
|
||||
// FIXME: typings: parseTorrent now returns an async result
|
||||
const parsedTorrent = await (parseTorrent(buf) as unknown as Promise<Instance>)
|
||||
|
||||
if (parsedTorrent.files.length !== 1) {
|
||||
cleanUpReqFiles(req)
|
||||
|
|
|
@ -38,7 +38,7 @@ export function isSignupAllowedForCurrentIP (ip: string) {
|
|||
let matched = ''
|
||||
|
||||
// if there is a valid, non-empty whitelist, we exclude all unknown addresses too
|
||||
if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isIPV4Cidr(cidr) || isIPV6Cidr(cidr))) {
|
||||
if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.some(cidr => isIPV4Cidr(cidr) || isIPV6Cidr(cidr))) {
|
||||
excludeList.push('unknown')
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue