This commit is contained in:
AJ ONeal 2018-06-13 12:34:45 -06:00
parent 70cb390579
commit 27c1b0ceeb
1 changed files with 11 additions and 2 deletions

View File

@ -129,7 +129,7 @@ function serveControls() {
// relay, email, agree_tos, servernames, ports // relay, email, agree_tos, servernames, ports
// //
opts.body.forEach(function (opt) { opts.body.forEach(function (opt) {
var parts = opt.split(/,/); var parts = opt.split(/:/);
conf[parts[0]] = parts[1]; conf[parts[0]] = parts[1];
}); });
if (!state.config.relay || !state.config.email || !state.config.agreeTos) { if (!state.config.relay || !state.config.email || !state.config.agreeTos) {
@ -166,7 +166,16 @@ function serveControls() {
if (!state.config.relay || !state.config.email || !state.config.agreeTos) { if (!state.config.relay || !state.config.email || !state.config.agreeTos) {
res.statusCode = 400; res.statusCode = 400;
res.end('{"error":{"code":"E_CONFIG","message":"Missing important config file params. Please run \'telebit init\'"}}');
res.end(JSON.stringify({
error: {
code: "E_INIT"
, message: "Missing important config file params"
, _params: JSON.stringify(conf)
, _config: JSON.stringify(state.config)
, _body: JSON.stringify(opts.body)
}
}));
return; return;
} }