diff options
author | Dr Scofield | 2008-05-19 18:30:25 +0000 |
---|---|---|
committer | Dr Scofield | 2008-05-19 18:30:25 +0000 |
commit | 4b622ec8815cb7de37db701aa33b693120263fe0 (patch) | |
tree | 097616834050ae63f91e26d3fd6e053161ea7de2 | |
parent | i'm dropping VerifyGod() and adding IsGod(OSHttpRequest) instead, which actua... (diff) | |
download | opensim-SC_OLD-4b622ec8815cb7de37db701aa33b693120263fe0.zip opensim-SC_OLD-4b622ec8815cb7de37db701aa33b693120263fe0.tar.gz opensim-SC_OLD-4b622ec8815cb7de37db701aa33b693120263fe0.tar.bz2 opensim-SC_OLD-4b622ec8815cb7de37db701aa33b693120263fe0.tar.xz |
(from awebb)
Fixes a bug in BaseRequestHandler.
If the length of the patter is equal to, or greater than, the length of
the actual request path, then an exception is thrown. System using is
added to support use of String.Empty. Exception is used to ensure most
efficient operation on (assumed to be most common) successful case.
-rw-r--r-- | OpenSim/Framework/Servers/BaseRequestHandler.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/BaseRequestHandler.cs b/OpenSim/Framework/Servers/BaseRequestHandler.cs index f9f2d8f..ddc8e92 100644 --- a/OpenSim/Framework/Servers/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/BaseRequestHandler.cs | |||
@@ -25,6 +25,8 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | |||
28 | namespace OpenSim.Framework.Servers | 30 | namespace OpenSim.Framework.Servers |
29 | { | 31 | { |
30 | public class BaseRequestHandler | 32 | public class BaseRequestHandler |
@@ -56,7 +58,14 @@ namespace OpenSim.Framework.Servers | |||
56 | 58 | ||
57 | protected string GetParam(string path) | 59 | protected string GetParam(string path) |
58 | { | 60 | { |
59 | return path.Substring(m_path.Length); | 61 | try |
62 | { | ||
63 | return path.Substring(m_path.Length); | ||
64 | } | ||
65 | catch (Exception) | ||
66 | { | ||
67 | return String.Empty; | ||
68 | } | ||
60 | } | 69 | } |
61 | } | 70 | } |
62 | } | 71 | } |