aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
diff options
context:
space:
mode:
authorlbsa712009-05-07 06:31:16 +0000
committerlbsa712009-05-07 06:31:16 +0000
commitf3db3d6a001abdca53d88def7a22a40d6aa30271 (patch)
tree666a0a4132d3fc67fcb60e8b5a098c0066dbc685 /OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
parentrefactoring Scene.NewUserConnection() to be simpler and clearer. (diff)
downloadopensim-SC-f3db3d6a001abdca53d88def7a22a40d6aa30271.zip
opensim-SC-f3db3d6a001abdca53d88def7a22a40d6aa30271.tar.gz
opensim-SC-f3db3d6a001abdca53d88def7a22a40d6aa30271.tar.bz2
opensim-SC-f3db3d6a001abdca53d88def7a22a40d6aa30271.tar.xz
* Added some more GetAssetStreamHandlerTests
* In the process, caught a potential bug where the handler would allow paths not starting with the registered prefix
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
index 5ad4520..da4f9a8 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
@@ -58,14 +58,22 @@ namespace OpenSim.Framework.Servers.HttpServer
58 58
59 public string GetParam(string path) 59 public string GetParam(string path)
60 { 60 {
61 try 61 if (CheckParam(path))
62 { 62 {
63 return path.Substring(m_path.Length); 63 return path.Substring(m_path.Length);
64 } 64 }
65 catch (Exception) 65
66 return String.Empty;
67 }
68
69 protected bool CheckParam(string path)
70 {
71 if(String.IsNullOrEmpty(path))
66 { 72 {
67 return String.Empty; 73 return false;
68 } 74 }
75
76 return path.StartsWith(Path);
69 } 77 }
70 } 78 }
71} 79}