Feature/multiple endpoints (#938)

* Add support for multiple endpoints for webserver
* Add support for a default endpoint (redirect) in webgui
* Always serve prod gui
* Update webgui deps
This commit is contained in:
Emil Axelsson
2019-07-19 16:49:54 +02:00
committed by GitHub
parent 134468b0d5
commit 5079f3fc60
7 changed files with 231 additions and 44 deletions

View File

@@ -41,15 +41,29 @@ namespace {
std::string escapedLuaString(const std::string& str) {
std::string luaString;
for (const char& c : str) {
switch (c) {
case '\'':
luaString += "\'";
break;
default:
luaString += c;
case '\t':
luaString += "\\t"; // Replace tab with \t.
break;
case '"':
luaString += "\\\""; // Replace " with \".
break;
case '\\':
luaString += "\\\\"; // Replace \ with \\.
break;
case '\n':
luaString += "\\\\n"; // Replace newline with \n.
break;
case '\r':
luaString += "\\r"; // Replace carriage return with \r.
break;
default:
luaString += c;
}
}
return luaString;
}