Exemple #1
0
        public HttpHandler(FrontierSetings setings, IMetricScope metricScope, ILog log, IAirlockClient airlockClient)
        {
            this.log           = log;
            this.airlockClient = airlockClient;
            log.Debug("settings: " + setings?.ToPrettyJson());
            var httpScope = metricScope.WithTag(MetricsTagNames.Type, "http");

            resendTo = setings?.ResendTo;
            if (string.IsNullOrWhiteSpace(resendTo))
            {
                resendTo = null;
            }
            else
            {
                resendHttpClient = new HttpClient();
            }

            reportHandlers = new IReportHandler[]
            {
                new StacktraceHandler("stacktracejs", httpScope, log, setings),
                new ReportHandler <CspReport>("csp", httpScope, log),
                new ReportHandler <PkpReport>("pkp", httpScope, log)
            };
            var handlerScope = metricScope.WithTag(MetricsTagNames.Operation, "handler");

            totalCounter = handlerScope.Counter("total");
            errorCounter = handlerScope.Counter("errors");
            environment  = VostokHostingEnvironment.Current.Environment;
        }
        public StacktraceHandler(string name, IMetricScope metricScope, ILog log, FrontierSetings setings)
            : base(name, metricScope, log)
        {
            this.log     = log;
            this.setings = setings;
            var handler = new HttpClientHandler
            {
                AllowAutoRedirect = false
            };

            httpClient = new HttpClient(handler);
            cache      = new NullSafeMemoryCache();
        }
 public CorsMiddleware(RequestDelegate next, FrontierSetings setings, ILog log)
 {
     this.next    = next;
     this.setings = setings;
     this.log     = log;
 }