aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs33
1 files changed, 19 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 821c60e..faa6f3c 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -90,8 +90,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
90 private int httpTimeout = 30000; 90 private int httpTimeout = 30000;
91 private string m_name = "HttpScriptRequests"; 91 private string m_name = "HttpScriptRequests";
92 92
93 private string m_proxyurl = ""; 93 private string m_proxyurl = "";
94 private string m_proxyexcepts = ""; 94 private string m_proxyexcepts = "";
95 95
96 // <request id, HttpRequestClass> 96 // <request id, HttpRequestClass>
97 private Dictionary<UUID, HttpRequestClass> m_pendingRequests; 97 private Dictionary<UUID, HttpRequestClass> m_pendingRequests;
@@ -155,8 +155,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
155 htc.HttpTimeout = httpTimeout; 155 htc.HttpTimeout = httpTimeout;
156 htc.OutboundBody = body; 156 htc.OutboundBody = body;
157 htc.ResponseHeaders = headers; 157 htc.ResponseHeaders = headers;
158 htc.proxyurl = m_proxyurl; 158 htc.proxyurl = m_proxyurl;
159 htc.proxyexcepts = m_proxyexcepts; 159 htc.proxyexcepts = m_proxyexcepts;
160 160
161 lock (HttpListLock) 161 lock (HttpListLock)
162 { 162 {
@@ -344,21 +344,26 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
344 Request = (HttpWebRequest) WebRequest.Create(Url); 344 Request = (HttpWebRequest) WebRequest.Create(Url);
345 Request.Method = HttpMethod; 345 Request.Method = HttpMethod;
346 Request.ContentType = HttpMIMEType; 346 Request.ContentType = HttpMIMEType;
347 if (proxyurl.Length > 0) 347
348 { 348 if (proxyurl != null && proxyurl.Length > 0)
349 if (proxyexcepts.Length > 0) { 349 {
350 string[] elist = proxyexcepts.Split(';'); 350 if (proxyexcepts != null && proxyexcepts.Length > 0)
351 Request.Proxy = new WebProxy(proxyurl,true,elist); 351 {
352 } else { 352 string[] elist = proxyexcepts.Split(';');
353 Request.Proxy = new WebProxy(proxyurl,true); 353 Request.Proxy = new WebProxy(proxyurl, true, elist);
354 } 354 }
355 } 355 else
356 {
357 Request.Proxy = new WebProxy(proxyurl, true);
358 }
359 }
356 360
357 foreach (KeyValuePair<string, string> entry in ResponseHeaders) 361 foreach (KeyValuePair<string, string> entry in ResponseHeaders)
358 Request.Headers[entry.Key] = entry.Value; 362 Request.Headers[entry.Key] = entry.Value;
359 363
360 // Encode outbound data 364 // Encode outbound data
361 if (OutboundBody.Length > 0) { 365 if (OutboundBody.Length > 0)
366 {
362 byte[] data = Encoding.UTF8.GetBytes(OutboundBody); 367 byte[] data = Encoding.UTF8.GetBytes(OutboundBody);
363 368
364 Request.ContentLength = data.Length; 369 Request.ContentLength = data.Length;