* Added some more GetAssetStreamHandlerTests

* In the process, caught a potential bug where the handler would allow paths not starting with the registered prefix
This commit is contained in:
lbsa71
2009-05-07 06:31:16 +00:00
parent 1352a19838
commit f3db3d6a00
2 changed files with 52 additions and 4 deletions

View File

@@ -58,14 +58,22 @@ namespace OpenSim.Framework.Servers.HttpServer
public string GetParam(string path)
{
try
if (CheckParam(path))
{
return path.Substring(m_path.Length);
}
catch (Exception)
return String.Empty;
}
protected bool CheckParam(string path)
{
if(String.IsNullOrEmpty(path))
{
return String.Empty;
return false;
}
return path.StartsWith(Path);
}
}
}