You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

#if NETFX
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace Apewer.Web
{
/// <summary>ApiHttpHandler</summary>
public class ApiHttpHandler : IHttpHandler
{
/// <summary></summary>
public bool IsReusable { get { return false; } }
/// <summary></summary>
public void ProcessRequest(HttpContext context)
{
//// 忽略跨域选项请求。
//if (context.Request.HttpMethod.ToLower() == "options") return;
//// 阻止浏览器请求网站图标。
//if (context.Request.Url.AbsolutePath.ToLower().StartsWith("/favicon.ico")) return;
//// 阻止搜索引擎收录。
//if (context.Request.Url.AbsolutePath.ToLower().StartsWith("/robot.txt"))
//{
// context.Response.ContentType = "text/plain";
// context.Response.Write("User-agent: *\nDisallow: / \n");
// return;
//}
ApiInvoker.Execute();
}
}
}
#endif