Esempio n. 1
0
        public string EvaluateProxyName(ProxyContext context)
        {
            var eval = context.Evaluate(ProxyNameExpression);

            return(string.IsNullOrWhiteSpace(eval)
                ? Defaults.Route.Proxy.ProxyName
                : eval);
        }
        public TimeSpan EvaluateTimeout(ProxyContext context)
        {
            var result = context.Evaluate(TimeoutInMillisecondsExpression);

            return(long.TryParse(result, out var timeout) && timeout > 0
                ? TimeSpan.FromMilliseconds(timeout)
                : Defaults.Route.Proxy.Upstream.Request.Sender.Timeout);
        }
Esempio n. 3
0
        public Version EvaluateHttpVersion(ProxyContext context)
        {
            var result = context.Evaluate(HttpVersionExpression);

            return(HttpVersion.ParseOrDefault(result) ?? Defaults.Route.Proxy.Upstream.Request.HttpVersion);
        }
Esempio n. 4
0
 public IEnumerable <string> EvaluateValues(ProxyContext context)
 => ValueExpressions.Select(v => context.Evaluate(v));
Esempio n. 5
0
 public string?EvaluateDomain(ProxyContext context)
 => context.Evaluate(DomainExpression);