diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index bbbe3f2..c47b5dc 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -27,6 +27,12 @@ namespace FLocal.IISHandler { } #endregion + #region robots + if(context.httprequest.Path.ToLower().StartsWith("/robots.txt")) { + return new handlers.response.RobotsHandler(); + } + #endregion + switch(context.requestParts[0].ToLower()) { case "q": return new handlers.response.QuickLinkHandler(); @@ -97,6 +103,8 @@ namespace FLocal.IISHandler { return new handlers.response.UserPostsHandler(); case "replies": return new handlers.response.UserRepliesHandler(); + case "pollsparticipated": + return new handlers.response.UserPollsParticipatedHandler(); default: return new handlers.WrongUrlHandler(); } diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index 7e4276a..80e14e4 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -97,6 +97,7 @@ + diff --git a/IISMainHandler/handlers/response/RobotsHandler.cs b/IISMainHandler/handlers/response/RobotsHandler.cs new file mode 100644 index 0000000..a3581ab --- /dev/null +++ b/IISMainHandler/handlers/response/RobotsHandler.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Text.RegularExpressions; +using System.IO; +using FLocal.Core; + +namespace FLocal.IISHandler.handlers.response { + class RobotsHandler : ISpecificHandler { + + public RobotsHandler() { + } + + public void Handle(WebContext context) { + context.httpresponse.ContentType = "text/plain"; + context.httpresponse.WriteLine("User-agent: *"); + context.httpresponse.WriteLine("Disallow: /"); + } + + } +}