diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 7142103ead..bdaecc5af1 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -358,7 +358,10 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest } foreach (KeyValuePair entry in ResponseHeaders) - Request.Headers[entry.Key] = entry.Value; + if (entry.Key.ToLower().Equals("user-agent")) + Request.UserAgent = entry.Value; + else + Request.Headers[entry.Key] = entry.Value; // Encode outbound data if (OutboundBody.Length > 0) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0908cd650e..6bb0fe9cf2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8726,6 +8726,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api httpHeaders["X-SecondLife-Local-Rotation"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000})", rotation.X, rotation.Y, rotation.Z, rotation.W); httpHeaders["X-SecondLife-Owner-Name"] = scenePresence == null ? string.Empty : scenePresence.ControllingClient.Name; httpHeaders["X-SecondLife-Owner-Key"] = m_host.ObjectOwner.ToString(); + string userAgent = config.Configs["Network"].GetString("user_agent", null); + if (userAgent != null) + httpHeaders["User-Agent"] = userAgent; UUID reqID = httpScriptMod. StartHttpRequest(m_localID, m_itemID, url, param, httpHeaders, body); diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 7f1c55be6e..b62cd771b1 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -327,6 +327,12 @@ InterregionComms = "RESTComms" ; The old default is "OpenSim", set here fro compatibility shard = "OpenSim" + ; What is reported as the "User-Agent" when using llHTTPRequest + ; Defaults to not sent if not set here. See the notes section in the wiki at + ; http://wiki.secondlife.com/wiki/LlHTTPRequest for comments on adding + ; " (Mozilla Compatible)" to the text where there are problems with a web server + ;user_agent = "OpenSim LSL (Mozilla Compatible)" + [ClientStack.LindenUDP] ; This is the multiplier applied to all client throttles for outgoing UDP network data ; If it is set to 1, then we obey the throttle settings as given to us by the client. If it is set to 3, for example, then we @@ -1063,4 +1069,4 @@ InterregionComms = "RESTComms" channel_notify = -800 [MRM] - Enabled = false ; Enables the Mini Region Modules Script Engine. WARNING: SECURITY RISK. \ No newline at end of file + Enabled = false ; Enables the Mini Region Modules Script Engine. WARNING: SECURITY RISK.