mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
* 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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user