
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 0.62 KB | hits: 7 | expires: Never
Allow/block the incoming request based on the request header in IIS/Sharepoint server
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
}