same domain upload result check
432227
function(){
            var _body,_text;
            try{
                var _body = this.__frame.contentWindow.document.body,
                    _text = (_body.innerText||_body.textContent||'').trim();
                // check result for same domain with upload proxy html
                if (_text.indexOf(_xflag)>=0||
                    _body.innerHTML.indexOf(_xflag)>=0){
                    // use post message path
                    return;
                }
            }catch(ex){
                // ignore if not same domain
                return;
            }
            this.__onLoadRequest(_text);
        }
1179046
def check_many(self, domains):
        
        return dict((item.domain, item.status) for item in self.check_domain_request(domains))
682462
def check_for_upload_create(self, relative_path=None):
        """"""
        for f in os.listdir(
            path_join(
                self.local_path, relative_path) if relative_path else self.local_path
        ):
            self.node_check_for_upload_create(relative_path, f)
970340
def verify_challenge(uri):
    
    while True:
        try:
            resp = urlopen(uri)
            challenge_status = json.loads(resp.read().decode('utf8'))
        except IOError as e:
            raise ValueError("Error checking challenge: {0} {1}".format(
                e.code, json.loads(e.read().decode('utf8'))))
        if challenge_status['status'] == "pending":
            time.sleep(2)
        elif challenge_status['status'] == "valid":
            LOGGER.info("Domain verified!")
            break
        else:
            raise ValueError("Domain challenge did not pass: {0}".format(
                challenge_status))
207678
function checkFileUploads()
    {
        $isFileUploadsEnabled = ini_get( 'file_uploads' ) != 0;
        if ( !$isFileUploadsEnabled )
        {
            if ( empty( $GLOBALS['eZMediaTypeWarningAdded'] ) )
            {
                eZAppendWarningItem( array( 'error' => array( 'type' => 'kernel',
                                                              'number' => eZError::KERNEL_NOT_AVAILABLE ),
                                            'text' => ezpI18n::tr( 'kernel/classes/datatypes',
                                                              'File uploading is not enabled. Please contact the site administrator to enable it.' ) ) );
                $GLOBALS['eZMediaTypeWarningAdded'] = true;
            }
        }
    }
244816
function hostInDomains(host, domains) {
  if (!defined(domains)) {
    return false;
  }

  host = host.toLowerCase();
  for (var i = 0; i < domains.length; i++) {
    if (host.match("(^|\\.)" + domains[i] + "$")) {
      return true;
    }
  }
  return false;
}
1292317
function useNonce($server_url, $timestamp, $salt)
    {
        global $Auth_OpenID_SKEW;

        if (!$this->active) {
            trigger_error("FileStore no longer active", E_USER_ERROR);
            return null;
        }

        if ( abs($timestamp - time()) > $Auth_OpenID_SKEW ) {
            return false;
        }

        if ($server_url) {
            list($proto, $rest) = explode('://', $server_url, 2);
        } else {
            $proto = '';
            $rest = '';
        }

        $parts = explode('/', $rest, 2);
        $domain = $this->_filenameEscape($parts[0]);
        $url_hash = $this->_safe64($server_url);
        $salt_hash = $this->_safe64($salt);

        $filename = sprintf('%08x-%s-%s-%s-%s', $timestamp, $proto,
                            $domain, $url_hash, $salt_hash);
        $filename = $this->nonce_dir . DIRECTORY_SEPARATOR . $filename;

        $result = @fopen($filename, 'x');

        if ($result === false) {
            return false;
        } else {
            fclose($result);
            return true;
        }
    }
431018
private function checkDomain(Request $request, $domain, &$params)
    {
        $params = [];
        if(Text::isEmpty($domain))
        {
            return true;
        }
        if(!is_array($domain))
        {
            $domain = [$domain];
        }
        foreach($domain as $rule)
        {
            $rule = $this->parseRule($rule, $fields);
            if(preg_match_all($rule, $request->getUri()->getDomain(), $matches) > 0)
            {
                $params = [];
                foreach($fields as $i => $fieldName)
                {
                    $params[$fieldName] = $matches[$i + 1][0];
                }
                return true;
            }
        }
        return false;
    }
908037
def check_infile(filename):
    
    if os.path.isfile(filename):
        domain = os.path.basename(filename).split('.txt')[0]
        return domain
    else:
        sys.stderr.write("ERROR: %s : No such file\n" % filename)
        sys.exit(1)
1124933
def domain_score(self, domains):
        
        warn(
            'OpenDNS Domain Scores endpoint is deprecated. Use '
            'InvestigateApi.categorization() instead', DeprecationWarning,
        )
        url_path = 'domains/score/'
        return self._multi_post(url_path, domains)
1192397
function maybeCreateAliasRecords(result, callback) {

      let records = result.records.ResourceRecordSets.filter(r=> r.Type === 'A').map(r=> r.Name)
      let stagingExists = records.includes(`staging.${domain}.`)
      let productionExists = records.includes(`${domain}.`)
      let skip = stagingExists && productionExists
      if (skip) {
        let records = result.records.ResourceRecordSets.filter(r=> r.Type === 'A')
        let staging = records.find(r=> r.Name === `staging.${domain}.`)
        let production = records.find(r=> r.Name === `${domain}.`)
        console.log(chalk.green.dim('✔ A Records'))
        console.log(chalk.grey(`          Production ${chalk.green.bold.underline(production.Name)}`))
        console.log(chalk.grey(`             Staging ${chalk.green.bold.underline(staging.Name)}`))
        callback()
      }
      else {

        let staging = result.apis.items.find(api=> api.domainName === `staging.${domain}`)
        let production = result.apis.items.find(api=> api.domainName === domain)
        route53.changeResourceRecordSets({
          ChangeBatch: {
            Changes: [{
              Action: 'UPSERT',
              ResourceRecordSet: {
                AliasTarget: {
                  DNSName: production.distributionDomainName,
                  EvaluateTargetHealth: false,
                  HostedZoneId: 'Z2FDTNDATAQYW2', /* ah, yes of course */
                },
                Name: domain,
                Type: "A"
              }
            },
            {
              Action: 'UPSERT',
              ResourceRecordSet: {
                AliasTarget: {
                  DNSName: staging.distributionDomainName,
                  EvaluateTargetHealth: false,
                  HostedZoneId: 'Z2FDTNDATAQYW2', /* ah, yes of course */
                },
                Name: `staging.${domain}`,
                Type: "A"
              }

            }],
            Comment: "defined by .arc @domain " + domain
          },
          HostedZoneId
        },
        function done(err) {
          if (err) callback(err)
          else {
            console.log(chalk.green.dim('✔ Created A Records'))
            callback()
          }
        })
      }
    }
586180
function isDomainValid (domain) {
  if (!domain) {
    return false
  }

  const [min, max] = domain
  const isValid = isPresent(min) && !isNaN(min) && isPresent(max) && !isNaN(max)
  if (!isValid) {
    Logger.debug(`Invalid domain: [${min}, ${max}]`)
  }

  return isValid
}
127905
def perform(self):
        
        try:
            host = '{}://{}'.format(self._url.scheme, self._url.netloc)
            path = self._url.geturl().replace(host, '', 1)

            chunk = self.file.read(self._content_length)
            if self._upload_checksum:
                self._request_headers["upload-checksum"] = \
                    " ".join((
                        self._checksum_algorithm_name,
                        base64.b64encode(
                            self._checksum_algorithm(chunk).digest()
                        ).decode("ascii"),
                    ))
            self.handle.request("PATCH", path, chunk, self._request_headers)
            self._response = self.handle.getresponse()
            self.status_code = self._response.status
            self.response_headers = {k.lower(): v for k, v in self._response.getheaders()}
        except http.client.HTTPException as e:
            raise TusUploadFailed(e)
        # wrap connection related errors not raised by the http.client.HTTP(S)Connection
        # as TusUploadFailed exceptions to enable retries
        except OSError as e:
            if e.errno in (errno.EPIPE, errno.ESHUTDOWN, errno.ECONNABORTED, errno.ECONNREFUSED, errno.ECONNRESET):
                raise TusUploadFailed(e)
            raise e
832947
def url_is_from_any_domain(url, domains):
    """"""
    host = parse_url(url).netloc.lower()

    if host:
        return any(((host == d.lower()) or (host.endswith('.%s' % d.lower())) for d in domains))
    else:
        return False
624204
public function checkFileUploads()
    {
        $dUploadFile = -1;
        $sFileUploads = @ini_get('file_uploads');
        if ($sFileUploads !== false) {
            if ($sFileUploads && ($sFileUploads == '1' || strtolower($sFileUploads) == 'on')) {
                $dUploadFile = 2;
            } else {
                $dUploadFile = 1;
            }
        }

        return $dUploadFile;
    }
1003090
function userDomainIsPermitted(userDomains, permittedDomains) {
  var isPermitted = false;

  _.each(permittedDomains, function(permittedDomain) {
    _.each(userDomains, function(userDomain) {
      if(userDomain.toUpperCase() === permittedDomain.toUpperCase()) {
        isPermitted = true;
      }
    });
  });

  return isPermitted;
}
1373217
function compareUrl(urlA, urlB) {
  var same = false;
  
  // Remove url fragments
  if( urlA.indexOf('#') > -1)
      urlA = urlA.split('#')[0];
 
  if( urlB.indexOf('#') > -1)
      urlB = urlB.split('#')[0];
  
  if(urlA != '' || urlB != ''){
      //Remove common subdomain
      urlA = urlA.toLowerCase().replace('www.','');
      urlB = urlB.toLowerCase().replace('www.','');
      
      // Make sure anything ends with / 
      if( endsWith(urlA,'/') == false)
          urlA = urlA + '/';
          
      if( endsWith(urlB,'/') == false)
          urlB = urlB + '/';    
          
      // Look for full match
      if(urlA.toLowerCase() == urlB.toLowerCase())
          same = true;
     
  }
  return same;
}