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>melanie
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>
|
||||
|
|
Loading…
Reference in New Issue