From 062f26dda3b8f5700c41609d8e5b5da4cd402eea Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 28 Sep 2018 14:11:38 +0100 Subject: [PATCH] Remove POST /docs custom handler, now handled by redirects Implementing a system for signing into v1 via v2 using POSTs so the unauthenticated route is no longer necessary --- .../web/app/coffee/infrastructure/RedirectManager.coffee | 2 +- services/web/app/coffee/router.coffee | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/services/web/app/coffee/infrastructure/RedirectManager.coffee b/services/web/app/coffee/infrastructure/RedirectManager.coffee index 0777941244..d4a9dd7c9a 100644 --- a/services/web/app/coffee/infrastructure/RedirectManager.coffee +++ b/services/web/app/coffee/infrastructure/RedirectManager.coffee @@ -15,7 +15,7 @@ module.exports = RedirectManager = if typeof target is 'string' url = target else - if req.method == "POST" + if req.method != "GET" code = 307 if typeof target.url == "function" diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 578ff0ceb7..954356c4a0 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -331,12 +331,6 @@ module.exports = class Router AuthenticationController.httpAuth, CompileController.getFileFromClsiWithoutUser - # We want to redirect POST and GET to different locations, but this is - # unsupported by RedirectManager. Therefore we redirect GETs with - # RedirectManager and POSTs with this custom route - publicApiRouter.post '/docs', (req, res, next) -> - res.redirect(307, "#{Settings.overleaf.host}/docs") - webRouter.get '/teams', (req, res, next) -> # Match v1 behaviour - if the user is signed in, show their teams list # Otherwise show some information about teams