Robots handler implemented

main
Inga 🏳‍🌈 15 years ago
parent 43201d730f
commit e556967725
  1. 8
      IISMainHandler/HandlersFactory.cs
  2. 1
      IISMainHandler/IISMainHandler.csproj
  3. 23
      IISMainHandler/handlers/response/RobotsHandler.cs

@ -27,6 +27,12 @@ namespace FLocal.IISHandler {
} }
#endregion #endregion
#region robots
if(context.httprequest.Path.ToLower().StartsWith("/robots.txt")) {
return new handlers.response.RobotsHandler();
}
#endregion
switch(context.requestParts[0].ToLower()) { switch(context.requestParts[0].ToLower()) {
case "q": case "q":
return new handlers.response.QuickLinkHandler(); return new handlers.response.QuickLinkHandler();
@ -97,6 +103,8 @@ namespace FLocal.IISHandler {
return new handlers.response.UserPostsHandler(); return new handlers.response.UserPostsHandler();
case "replies": case "replies":
return new handlers.response.UserRepliesHandler(); return new handlers.response.UserRepliesHandler();
case "pollsparticipated":
return new handlers.response.UserPollsParticipatedHandler();
default: default:
return new handlers.WrongUrlHandler(); return new handlers.WrongUrlHandler();
} }

@ -97,6 +97,7 @@
<Compile Include="handlers\response\UploadListHandler.cs" /> <Compile Include="handlers\response\UploadListHandler.cs" />
<Compile Include="handlers\response\UploadNewHandler.cs" /> <Compile Include="handlers\response\UploadNewHandler.cs" />
<Compile Include="handlers\response\UserInfoHandler.cs" /> <Compile Include="handlers\response\UserInfoHandler.cs" />
<Compile Include="handlers\response\UserPollsParticipatedHandler.cs" />
<Compile Include="handlers\response\UserPostsHandler.cs" /> <Compile Include="handlers\response\UserPostsHandler.cs" />
<Compile Include="handlers\response\UserRepliesHandler.cs" /> <Compile Include="handlers\response\UserRepliesHandler.cs" />
<Compile Include="handlers\response\WhoIsOnlineHandler.cs" /> <Compile Include="handlers\response\WhoIsOnlineHandler.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: /");
}
}
}
Loading…
Cancel
Save