returns true if the default url option should be set for this request
492100
def set_default_url_option_for_request?
      RailsLocaleDetection.set_default_url_option === true || RailsLocaleDetection.set_default_url_option == :always || RailsLocaleDetection.set_default_url_option == :explicitly && params[locale_key].present?
    end
958613
function formatURL(httpOptions) {
  var url;
  if (httpOptions.protocol) {
    url = httpOptions.protocol;
  } else {
    url = 'http:';
  }
  url += '//';
  if (httpOptions.auth) {
    url += httpOptions.auth + '@';
  }
  if (httpOptions.host) {
    url += httpOptions.host;
  } else if (httpOptions.hostname) {
    url += httpOptions.hostname;
  } else {
    url += 'localhost';
  }
  if (httpOptions.port && !url.includes(':' + httpOptions.port)) {
    url += ':' + httpOptions.port;
  }
  if (httpOptions.path) {
    url += httpOptions.path;
  } else {
    url += '/';
  }
  return url;
}
54982
def _IsValidUrl(self, url):
    
    parsed_url = urlparse.urlparse(url)
    return parsed_url.scheme in self._SUPPORTED_URL_SCHEMES
1267986
@Override
    public IPortalUrlBuilder getDefaultUrl(HttpServletRequest request) {
        final IUrlNodeSyntaxHelper urlNodeSyntaxHelper =
                this.urlNodeSyntaxHelperRegistry.getCurrentUrlNodeSyntaxHelper(request);
        final String defaultLayoutNodeId = urlNodeSyntaxHelper.getDefaultLayoutNodeId(request);
        return this.getPortalUrlBuilderByLayoutNode(request, defaultLayoutNodeId, UrlType.RENDER);
    }
741664
public static boolean isUsingNonDefaultPort(URI uri) {
        String scheme = StringUtils.lowerCase(uri.getScheme());
        int port = uri.getPort();

        if (port <= 0) return false;
        if (scheme.equals("http") && port == 80) return false;
        if (scheme.equals("https") && port == 443) return false;

        return true;
    }
1101798
def is_url(default_scheme='http', **kwargs):
    """"""
    def converter(value):
        if value is None:
            return value
        if '://' not in value and default_scheme:
            value = '://'.join((default_scheme, value.strip()))
        try:
            return uris.validate(value)
        except uris.ValidationError as e:
            raise Invalid(e.message)
    return converter
96306
function defaults(route, name, handle) {
  if (typeof route === 'function') {
    handle = route;
    name = handle.name;
    route = '/';
  }
  else if (typeof name === 'function') {
    handle = name;
    name = handle.name;
  }

  // A name needs to be provided
  if (!name) throw new NameError();

  // wrap sub-apps
  if ('function' == typeof handle.handle) {
    var server = handle;
    handle.route = route;
    handle = function(req, res, next){
      server.handle(req, res, next);
    };
  }

  // wrap vanilla http.Servers
  if (handle instanceof http.Server) {
    handle = handle.listeners('request')[0];
  }

  // strip trailing slash
  if ('/' == route[route.length - 1]) {
    route = route.slice(0, -1);
  }

  return {route: route, name: name, handle: handle};
}
10388
def options(self, context, module_options):
        '''
        
        '''

        if not 'URL' in module_options:
            context.log.error('URL option is required!')
            exit(1)

        self.url = module_options['URL']
845253
public static boolean setDefaultCustomResponse(String pathValue, String requestType, String customData) {
        try {
            JSONObject profile = getDefaultProfile();
            String profileName = profile.getString("name");
            PathValueClient client = new PathValueClient(profileName, false);
            return client.setCustomResponse(pathValue, requestType, customData);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
673795
private function configureCurl()
    {
        foreach($this->getCurlOptions() as $option => $value){
            curl_setopt($this->CurlRequest,$option,$value);
        }
        return TRUE;
    }
1221989
function (e) {
            e.preventDefault();
            var $target = $(e.target);
            while ($target) {
                var route = $target.attr('route');
                if (route) {
                    // A route has been defined, follow the link using
                    // Jackbone's default router.
                    if (route === 'back') {
                        Jackbone.router.goto(this.back.hash);
                    } else {
                        Jackbone.router.goto(route);
                    }
                    return false;
                }
                var parent = $target.parent();
                if (parent.length > 0) {
                    $target = parent;
                } else {
                    $target = false;
                }
            }
            return true;
        }
402900
def set_default(self):
        
        req = self.request(self.mist_client.uri+'/keys/'+self.id)
        req.post()
        self.is_default = True
        self.mist_client.update_keys()
553946
def url_for(option)
      host = SermepaWebTpv.response_host
      path = SermepaWebTpv.send(option)

      return if !host.present? || !path.present?
      URI.join(host, path).to_s
    end
894575
protected function supplementRequestWithDefaults()
    {
        parent::supplementRequestWithDefaults();

        // set the HTTP Method if it is set in the defaults
        if (empty($this->request->getHttpMethod()) && ! empty($this->defaults['http_method'])) {

            $this->request->setHttpMethod( $this->defaults['http_method'] );
        }
    }
1299129
@Override
    protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException {
        SiteContext siteContext = SiteContext.getCurrent();
        HierarchicalConfiguration config = siteContext.getConfig();
        try {
            HierarchicalConfiguration corsConfig = config.configurationAt(CONFIG_KEY);
            if (corsConfig != null) {
                return !corsConfig.getBoolean(ENABLE_KEY, false);
            }
        } catch (Exception e) {
            logger.debug("Site '{}' has no CORS configuration", siteContext.getSiteName());
        }
        return true;
    }
1071221
def set_request_defaults(endpoint, private_token, sudo=nil)
      raise Error::MissingCredentials.new("Please set an endpoint to API") unless endpoint
      @private_token = private_token

      self.class.base_uri endpoint
      self.class.default_params :sudo => sudo
      self.class.default_params.delete(:sudo) if sudo.nil?
    end
109202
async def make_default_options_response(self) -> Response:
        """"""
        methods = _request_ctx_stack.top.url_adapter.allowed_methods()
        return self.response_class('', headers={'Allow': ', '.join(methods)})