mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
* Workaround for application/llsd+xml requests coming in as application/xml
* When OGP is active, disable SSL certificate chain validation. I'll add more options here to come, as well as a way to test against a group of known certificate subjects.
This commit is contained in:
@@ -272,6 +272,13 @@ namespace OpenSim.Framework.Servers
|
||||
case "text/xml":
|
||||
case "application/xml":
|
||||
default:
|
||||
if (DoWeHaveALLSDHandler(request.RawUrl))
|
||||
{
|
||||
m_log.ErrorFormat("[BASE HTTP SERVER]: Potentially incorrect content type on Registered LLSD CAP: Content Type:{0}", request.ContentType);
|
||||
HandleLLSDRequests(request, response);
|
||||
|
||||
return;
|
||||
}
|
||||
HandleXmlRpcRequests(request, response);
|
||||
return;
|
||||
}
|
||||
@@ -532,6 +539,47 @@ namespace OpenSim.Framework.Servers
|
||||
}
|
||||
}
|
||||
|
||||
private bool DoWeHaveALLSDHandler(string path)
|
||||
{
|
||||
|
||||
string[] pathbase = path.Split('/');
|
||||
string searchquery = "/";
|
||||
|
||||
if (pathbase.Length < 1)
|
||||
return false;
|
||||
|
||||
for (int i = 1; i < pathbase.Length; i++)
|
||||
{
|
||||
searchquery += pathbase[i];
|
||||
if (pathbase.Length - 1 != i)
|
||||
searchquery += "/";
|
||||
}
|
||||
|
||||
string bestMatch = null;
|
||||
|
||||
foreach (string pattern in m_llsdHandlers.Keys)
|
||||
{
|
||||
if (searchquery.StartsWith(searchquery))
|
||||
{
|
||||
if (String.IsNullOrEmpty(bestMatch) || searchquery.Length > bestMatch.Length)
|
||||
{
|
||||
bestMatch = pattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(bestMatch))
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryGetLLSDHandler(string path, out LLSDMethod llsdHandler)
|
||||
{
|
||||
llsdHandler = null;
|
||||
|
||||
Reference in New Issue
Block a user