using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
|
namespace Pcb.Api.Infrastructures
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class HttpInterceptModule : IHttpModule
|
{
|
public void Dispose()
|
{
|
//throw new NotImplementedException();
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void ContextAuthenticateRequest(object sender, EventArgs e)
|
{
|
HttpApplication app = (HttpApplication)sender;
|
var absolutePath = HttpContext.Current.Request.Url.AbsolutePath.ToLower();
|
if (absolutePath == "/") HttpContext.Current.Response.Redirect("/swagger");
|
}
|
|
public void Init(HttpApplication context)
|
{
|
context.AuthenticateRequest += ContextAuthenticateRequest;
|
}
|
}
|
}
|