예제 #1
0
        internal void BeforeIntercept(IRestRequest request)
        {
            if (_signout || _noAuthRoute.Any(requestPath => requestPath.EndsWith(request.Resource)))
            {
                return;
            }

            if (InfluxDBClientOptions.AuthenticationScheme.Token.Equals(_options.AuthScheme))
            {
                request.AddHeader("Authorization", "Token " + new string(_options.Token));
            }
            else if (InfluxDBClientOptions.AuthenticationScheme.Session.Equals(_options.AuthScheme))
            {
                InitToken();

                if (_sessionToken != null)
                {
                    request.AddHeader("Cookie", "session=" + new string(_sessionToken));
                }
            }

            _loggingHandler.BeforeIntercept(request);
            _gzipHandler.BeforeIntercept(request);
        }
예제 #2
0
 protected override void BeforeIntercept(RestRequest request)
 {
     _loggingHandler.BeforeIntercept(request);
 }