diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 393fa7495d..1d975ac932 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -981,14 +981,16 @@ namespace OpenSim.Framework.Servers.HttpServer private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) { + if(m_streamHandlers.TryGetValue(handlerKey, out streamHandler)) + return true; + string bestMatch = null; lock (m_streamHandlers) { foreach (string pattern in m_streamHandlers.Keys) { - if ((handlerKey == pattern) - || (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0))) + if (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0)) { if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) {