Support for CORS with simple requests in BaseHttpServer

0.7-post-fixes
Marck 2010-11-01 13:36:30 +01:00 committed by Diva Canto
parent fc3e7fe700
commit c9e0eca544
1 changed files with 4 additions and 0 deletions

View File

@ -1442,6 +1442,10 @@ namespace OpenSim.Framework.Servers.HttpServer
if (responsedata.ContainsKey("reusecontext"))
response.ReuseContext = (bool) responsedata["reusecontext"];
// Cross-Origin Resource Sharing with simple requests
if (responsedata.ContainsKey("access_control_allow_origin"))
response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]);
//Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this
//and should check for NullReferenceExceptions