Пример #1
0
 public HttpRequestLog(UrlLog url, string method, string?contentType, IReadOnlyList <KeyValuePair <string, string> > headers, IReadOnlyList <KeyValuePair <string, string> > cookies)
 {
     Url         = url;
     Method      = method;
     ContentType = contentType;
     Headers     = headers;
     Cookies     = cookies;
 }
Пример #2
0
        public HttpRequestLog Create(HttpRequest request)
        {
            var parameters = Map(request.Query, _dataProtector,
                                 _options.Request.SensitiveData.Parameters,
                                 null);

            var headers = Map(request.Headers, _dataProtector,
                              _options.Request.SensitiveData.Headers,
                              _options.Request.IgnoreHeaders);

            var cookies = Map(request.Cookies, _dataProtector,
                              _options.Request.SensitiveData.Cookies, null);

            var uri = new Uri(request.GetDisplayUrl());

            var url = new UrlLog(uri.Port, uri.AbsolutePath, uri.Host, uri.Scheme, parameters);

            return(new HttpRequestLog(url, request.Method, request.ContentType, headers, cookies));
        }