Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.62 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Allow/block the incoming request based on the request header in IIS/Sharepoint server
  2. String clientId=Request.getHeaderValue('clientID');
  3. String userAgent=Request.getHeaderValue('useragent');
  4.  
  5. //If clientId and userAgent are empty abort the request
  6.  
  7.  if(clientId.equals('') && userAgent.equals('')){
  8.  
  9. //Abort the request
  10. }
  11.  
  12. //If clientId is not empty but is not matching my expected value,then abort the    request.
  13. if(!clientId.equals('') && !clientId.equals('1234'){
  14.  
  15. //Abort the request
  16. }
  17.  
  18. //If userAgent is not matching my expected value ,then abort the request.
  19. if(!userAgent.equals('myfavbroswer')){
  20.  
  21. //Abort the request
  22.  
  23. }