From 831528e8bc1d47b0178402c145895d7c7edea14f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 1 Oct 2020 21:27:23 -0400 Subject: [PATCH] import: Allow import if pad does not yet exist --- src/node/hooks/express/importexport.js | 5 ----- tests/backend/specs/api/importexportGetPost.js | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/src/node/hooks/express/importexport.js b/src/node/hooks/express/importexport.js index f5c3c34cb..efb89b3c9 100644 --- a/src/node/hooks/express/importexport.js +++ b/src/node/hooks/express/importexport.js @@ -62,11 +62,6 @@ exports.expressCreateServer = function (hook_name, args, cb) { // handle import requests args.app.use('/p/:pad/import', limiter); args.app.post('/p/:pad/import', async function(req, res, next) { - if (!(await padManager.doesPadExists(req.params.pad))) { - console.warn(`Someone tried to import into a pad that doesn't exist (${req.params.pad})`); - return next(); - } - const {session: {user} = {}} = req; const {accessStatus, authorID} = await securityManager.checkAccess( req.params.pad, req.cookies.sessionID, req.cookies.token, req.cookies.password, user); diff --git a/tests/backend/specs/api/importexportGetPost.js b/tests/backend/specs/api/importexportGetPost.js index 95995cbcb..27f4758a0 100644 --- a/tests/backend/specs/api/importexportGetPost.js +++ b/tests/backend/specs/api/importexportGetPost.js @@ -211,16 +211,6 @@ describe('Imports and Exports', function(){ .expect(/