Merge branch 'master' into httptests

This commit is contained in:
UbitUmarov
2016-12-30 01:52:02 +00:00
23 changed files with 271 additions and 62 deletions

View File

@@ -206,6 +206,7 @@ namespace OpenSim
MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this));
if (userStatsURI != String.Empty)
MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this));
MainServer.Instance.AddStreamHandler(new OpenSim.SimRobotsHandler());
if (managedStatsURI != String.Empty)
{

View File

@@ -898,6 +898,26 @@ namespace OpenSim
}
}
/// <summary>
/// handler to supply serving http://domainname:port/robots.txt
/// </summary>
public class SimRobotsHandler : BaseStreamHandler
{
public SimRobotsHandler() : base("GET", "/robots.txt", "SimRobots.txt", "Simulator Robots.txt") {}
protected override byte[] ProcessRequest(string path, Stream request,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
string robots = "# go away\nUser-agent: *\nDisallow: /\n";
return Util.UTF8.GetBytes(robots);
}
public override string ContentType
{
get { return "text/plain"; }
}
}
#endregion
/// <summary>