mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Serving robots.txt from bin Idea of solution for http://opensimulator.org/mantis/view.php?id=7392
Signed-off-by: Mandarinka Tasty <mandarinka.tasty@gmail.com> Signed-off-by: Melanie Thielker <melanie@t-data.com>
This commit is contained in:
committed by
Melanie Thielker
parent
e0b5135010
commit
aee3f273f0
@@ -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)
|
||||
{
|
||||
|
||||
@@ -876,6 +876,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>
|
||||
|
||||
Reference in New Issue
Block a user