Iis 7 基于IIS/Sharepoint server中的请求标头允许/阻止传入请求

Iis 7 基于IIS/Sharepoint server中的请求标头允许/阻止传入请求,iis-7,sharepoint-2010,http-headers,Iis 7,Sharepoint 2010,Http Headers,我有在IIS 7.5上运行的sharepoint网站。我想根据请求头允许/阻止传入请求。这是我想实现的条件 这里clientId和userAgent是请求头 String clientId=Request.getHeaderValue('clientID'); String userAgent=Request.getHeaderValue('useragent'); //If clientId and userAgent are empty abort the request if(cli

我有在IIS 7.5上运行的sharepoint网站。我想根据请求头允许/阻止传入请求。这是我想实现的条件

这里clientId和userAgent是请求头

String clientId=Request.getHeaderValue('clientID');
String userAgent=Request.getHeaderValue('useragent');

//If clientId and userAgent are empty abort the request

 if(clientId.equals('') && userAgent.equals('')){

//Abort the request
} 

//If clientId is not empty but is not matching my expected value,then abort the    request.
if(!clientId.equals('') && !clientId.equals('1234'){

//Abort the request
}

//If userAgent is not matching my expected value ,then abort the request.
if(!userAgent.equals('myfavbroswer')){

//Abort the request

}
我已经看过IIS中的URLEwriteModule。它似乎不符合我的目的

这是我想要建立的粗略逻辑。我是IIS服务器和sharepoint的新手。有人能告诉我在哪里可以建立这个逻辑来达到我的目的吗


谢谢。

URLRewrite实际上符合我的目的。你只需要知道如何使用它。我只需要以不同的方式编写我的条件。它允许你创建任何你想要的条件。唯一的问题是它在开始时有点混乱。另外,如果你知道regexp,那么它将成为一个非常好的使用模块

编辑:这段视频让你很好地理解了如何做到这一点。

如果您添加一些关于如何解决问题的解释,将非常有用。我对基于http头的阻塞感兴趣。请浏览视频