Merge branch 'force_SSL' of https://github.com/wmantly/proxy into vagrant

This commit is contained in:
William Mantly 2019-12-10 01:40:21 -05:00
commit 729b6ecaba
Signed by: wmantly
GPG Key ID: E1EEC7650BA97160
2 changed files with 8 additions and 2 deletions

View File

@ -26,6 +26,9 @@ async function add(data){
await client.HSET('host_' + data.host, 'ip', data.ip); await client.HSET('host_' + data.host, 'ip', data.ip);
await client.HSET('host_' + data.host, 'updated', (new Date).getTime()); await client.HSET('host_' + data.host, 'updated', (new Date).getTime());
await client.HSET('host_' + data.host, 'username', data.username); await client.HSET('host_' + data.host, 'username', data.username);
if(data.forceSSL !== undefined){
await client.HSET('host_' + data.host, 'force_ssl', !!data.forceSSL);
}
} catch (error){ } catch (error){
return new Error(error); return new Error(error);

View File

@ -35,7 +35,10 @@ router.post('/', async function(req, res){
} }
try{ try{
Host.add({host, ip, username: req.user.username}); await Host.add({host, ip,
username: req.user.username,
forceSSL: req.body.forceSSL
});
return res.json({ return res.json({
message: `Host ${host} Added` message: `Host ${host} Added`