aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseHttpServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 0baddb8..de15923 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -440,6 +440,7 @@ namespace OpenSim.Framework.Servers
440 string[] querystringkeys = request.QueryString.AllKeys; 440 string[] querystringkeys = request.QueryString.AllKeys;
441 string[] rHeaders = request.Headers.AllKeys; 441 string[] rHeaders = request.Headers.AllKeys;
442 442
443
443 foreach (string queryname in querystringkeys) 444 foreach (string queryname in querystringkeys)
444 { 445 {
445 keysvals.Add(queryname, request.QueryString[queryname]); 446 keysvals.Add(queryname, request.QueryString[queryname]);
@@ -487,7 +488,16 @@ namespace OpenSim.Framework.Servers
487 { 488 {
488 int responsecode = (int)responsedata["int_response_code"]; 489 int responsecode = (int)responsedata["int_response_code"];
489 string responseString = (string)responsedata["str_response_string"]; 490 string responseString = (string)responsedata["str_response_string"];
490 491 string contentType = (string)responsedata["content_type"];
492
493 //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this
494 //and should check for NullReferenceExceptions
495
496 if (contentType == null || contentType == "")
497 {
498 contentType = "text/html";
499 }
500
491 // We're forgoing the usual error status codes here because the client 501 // We're forgoing the usual error status codes here because the client
492 // ignores anything but 200 and 301 502 // ignores anything but 200 and 301
493 503
@@ -498,7 +508,8 @@ namespace OpenSim.Framework.Servers
498 response.RedirectLocation = (string)responsedata["str_redirect_location"]; 508 response.RedirectLocation = (string)responsedata["str_redirect_location"];
499 response.StatusCode = responsecode; 509 response.StatusCode = responsecode;
500 } 510 }
501 response.AddHeader("Content-type", "text/html"); 511
512 response.AddHeader("Content-type", contentType);
502 513
503 byte[] buffer = Encoding.UTF8.GetBytes(responseString); 514 byte[] buffer = Encoding.UTF8.GetBytes(responseString);
504 515