mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
Add osRequestURL and osRequestSecureURL with an options list.
Only currently supported option is "allowXss" which will send the needed Access-control-allow-origin: * header to allow xss scripting against the LSL http server.
This commit is contained in:
@@ -12039,7 +12039,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (m_UrlModule != null)
|
||||
return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID).ToString();
|
||||
return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, null).ToString();
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
@@ -12157,7 +12157,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (m_UrlModule != null)
|
||||
return m_UrlModule.RequestURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID).ToString();
|
||||
return m_UrlModule.RequestURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, null).ToString();
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
|
||||
@@ -4134,5 +4134,41 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_String osRequestURL(LSL_List options)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
Hashtable opts = new Hashtable();
|
||||
for (int i = 0 ; i < options.Length ; i++)
|
||||
{
|
||||
object opt = options.Data[i];
|
||||
if (opt.ToString() == "allowXss")
|
||||
opts["allowXss"] = true;
|
||||
}
|
||||
|
||||
if (m_UrlModule != null)
|
||||
return m_UrlModule.RequestURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, opts).ToString();
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
public LSL_String osRequestSecureURL(LSL_List options)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
Hashtable opts = new Hashtable();
|
||||
for (int i = 0 ; i < options.Length ; i++)
|
||||
{
|
||||
object opt = options.Data[i];
|
||||
if (opt.ToString() == "allowXss")
|
||||
opts["allowXss"] = true;
|
||||
}
|
||||
|
||||
if (m_UrlModule != null)
|
||||
return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, opts).ToString();
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,5 +468,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
/// <param name="regex">string to use as pattern</param>
|
||||
/// <returns>boolean</returns>
|
||||
LSL_Integer osRegexIsMatch(string input, string pattern);
|
||||
|
||||
LSL_String osRequestURL(LSL_List options);
|
||||
LSL_String osRequestSecureURL(LSL_List options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1054,5 +1054,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_OSSL_Functions.osRegexIsMatch(input, pattern);
|
||||
}
|
||||
|
||||
public LSL_String osRequestURL(LSL_List options)
|
||||
{
|
||||
return m_OSSL_Functions.osRequestURL(options);
|
||||
}
|
||||
|
||||
public LSL_String osRequestSecureURL(LSL_List options)
|
||||
{
|
||||
return m_OSSL_Functions.osRequestSecureURL(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user