From 00791594ad4ed6d78bd6edbb2e02eaaf5c30c8ce Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 14 Jul 2008 13:51:54 +0000 Subject: Mantis#1739. Thank you kindly, Grumly57 for a patch that: Implements X-SecondLife-* HTTP Headers for llHTTPRequest --- .../Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Modules/Scripting/HttpRequest') diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 6e32362..c670ad7 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -37,6 +37,7 @@ using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; +using System.Collections; /***************************************************** * @@ -105,7 +106,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest return LLUUID.Zero; } - public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List parameters, string body) + public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List parameters, Dictionary headers, string body) { LLUUID reqID = LLUUID.Random(); HttpRequestClass htc = new HttpRequestClass(); @@ -150,6 +151,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest htc.reqID = reqID; htc.httpTimeout = httpTimeout; htc.outbound_body = body; + htc.response_headers = headers; lock (HttpListLock) { @@ -280,6 +282,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest public HttpWebRequest request; public string response_body; public List response_metadata; + public Dictionary response_headers; public int status; public string url; @@ -314,6 +317,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest request.Method = httpMethod; request.ContentType = httpMIMEType; + foreach (KeyValuePair entry in response_headers) + request.Headers[entry.Key] = entry.Value; + // Encode outbound data if (outbound_body.Length > 0) { byte[] data = Encoding.UTF8.GetBytes(outbound_body); -- cgit v1.1