From 0a43dad629099505701b14723f1b22ba013a869e Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 13 Jul 2016 00:45:31 +0600 Subject: CLOUD: Redirect to "/files" from "/" "/" is used to receive "?code", but when there is no such parameter passed, it's safe to redirect user to the "/files". --- backends/networking/sdl_net/handlers/indexpagehandler.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/backends/networking/sdl_net/handlers/indexpagehandler.cpp b/backends/networking/sdl_net/handlers/indexpagehandler.cpp index da5cd2d3f9..9208cd0b15 100644 --- a/backends/networking/sdl_net/handlers/indexpagehandler.cpp +++ b/backends/networking/sdl_net/handlers/indexpagehandler.cpp @@ -35,8 +35,18 @@ IndexPageHandler::~IndexPageHandler() {} void IndexPageHandler::handle(Client &client) { Common::String code = client.queryParameter("code"); - if (code == "") { - HandlerUtils::setMessageHandler(client, _("This is a local webserver index page.")); + if (code == "") { + // redirect to "/files" + HandlerUtils::setMessageHandler( + client, + Common::String::format( + "%s
%s", + _("This is a local webserver index page."), + client.queryParameter("path").c_str(), + _("Open Files manager") + ), + "/files" + ); return; } -- cgit v1.2.3