SHARE
TWEET

Untitled

a guest Feb 15th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub fn timing_allow_check(&self, request: &Request, headers: &HeaderMap) -> bool {
  2.         let header_check: bool = false;
  3.         let origin_check: bool = false;
  4.         header_check = {
  5.             let header_iter = headers.iter();
  6.             for (key, check_header) in header_iter {
  7.                 if re.is_match(check_header) || re.is_match(r"*") {
  8.                     true;
  9.                 }
  10.             }
  11.             false;
  12.         };
  13.  
  14.         origin_check = match request.origin {
  15.             Origin::ImmutableOrigin(Tuple) => Tuple.0 == request.current_url().into_string();
  16.             _ => false;
  17.         };
  18.         if header_check && origin_check {
  19.             return true;
  20.         }
  21.         return false;
  22.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top