diff options
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 7b2b599..13c5752 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -272,6 +272,13 @@ namespace OpenSim.Framework.Servers | |||
272 | case "text/xml": | 272 | case "text/xml": |
273 | case "application/xml": | 273 | case "application/xml": |
274 | default: | 274 | default: |
275 | if (DoWeHaveALLSDHandler(request.RawUrl)) | ||
276 | { | ||
277 | m_log.ErrorFormat("[BASE HTTP SERVER]: Potentially incorrect content type on Registered LLSD CAP: Content Type:{0}", request.ContentType); | ||
278 | HandleLLSDRequests(request, response); | ||
279 | |||
280 | return; | ||
281 | } | ||
275 | HandleXmlRpcRequests(request, response); | 282 | HandleXmlRpcRequests(request, response); |
276 | return; | 283 | return; |
277 | } | 284 | } |
@@ -532,6 +539,47 @@ namespace OpenSim.Framework.Servers | |||
532 | } | 539 | } |
533 | } | 540 | } |
534 | 541 | ||
542 | private bool DoWeHaveALLSDHandler(string path) | ||
543 | { | ||
544 | |||
545 | string[] pathbase = path.Split('/'); | ||
546 | string searchquery = "/"; | ||
547 | |||
548 | if (pathbase.Length < 1) | ||
549 | return false; | ||
550 | |||
551 | for (int i = 1; i < pathbase.Length; i++) | ||
552 | { | ||
553 | searchquery += pathbase[i]; | ||
554 | if (pathbase.Length - 1 != i) | ||
555 | searchquery += "/"; | ||
556 | } | ||
557 | |||
558 | string bestMatch = null; | ||
559 | |||
560 | foreach (string pattern in m_llsdHandlers.Keys) | ||
561 | { | ||
562 | if (searchquery.StartsWith(searchquery)) | ||
563 | { | ||
564 | if (String.IsNullOrEmpty(bestMatch) || searchquery.Length > bestMatch.Length) | ||
565 | { | ||
566 | bestMatch = pattern; | ||
567 | } | ||
568 | } | ||
569 | } | ||
570 | |||
571 | if (String.IsNullOrEmpty(bestMatch)) | ||
572 | { | ||
573 | |||
574 | return false; | ||
575 | } | ||
576 | else | ||
577 | { | ||
578 | |||
579 | return true; | ||
580 | } | ||
581 | } | ||
582 | |||
535 | private bool TryGetLLSDHandler(string path, out LLSDMethod llsdHandler) | 583 | private bool TryGetLLSDHandler(string path, out LLSDMethod llsdHandler) |
536 | { | 584 | { |
537 | llsdHandler = null; | 585 | llsdHandler = null; |