Added config options for RestApi

-IP now changes RestApi listening ip.
This commit is contained in:
high 2011-09-05 14:33:37 -04:00
parent 4b694c0c31
commit f949738db9
3 changed files with 14 additions and 3 deletions

View file

@ -58,11 +58,11 @@ namespace Rests
string hash;
var rand = new Random();
var randbytes = new byte[20];
var randbytes = new byte[32];
do
{
rand.NextBytes(randbytes);
hash = Tools.HashPassword(randbytes);
hash = randbytes.Aggregate("", (s, b) => s + b.ToString("X2"));
} while (Tokens.ContainsKey(hash));
Tokens.Add(hash, user);
@ -71,6 +71,8 @@ namespace Rests
return obj;
}
protected override object ExecuteCommand(RestCommand cmd, RestVerbs verbs, IParameterCollection parms)
{
if (cmd.RequiesToken)