mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +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
@@ -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