예제 #1
0
        private void ResponseWrite(HttpResponse response, MediaTypeHeaderValue contentType, long size, string content, HttpContext httpContext)
        {
            var webBody = new WebBody();

            ProcessBody(webBody, contentType, size, content);

            // TODO: TOTOAL HACK!!! need to find a better way of doing this.
            httpContext.Items.Add("__GlimpseCoreWebBody", webBody);

            // TODO: need to build message
            //_broker.SendMessage(message);
        }
예제 #2
0
        private void ProcessBody(WebBody webBody, MediaTypeHeaderValue contentType, long size, string content)
        {
            webBody.Encoding = contentType?.Encoding?.WebName;
            webBody.Content  = content;
            webBody.Size     = size;

            if (!string.IsNullOrEmpty(webBody.Content) &&
                webBody.Content.Length > MaxBodySize)
            {
                webBody.Content     = webBody.Content.Substring(0, MaxBodySize);
                webBody.IsTruncated = true;
            }
        }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name">name value</param>
 /// <param name="web">web info</param>
 public ExtensionAttribute(string name, WebBody web)
 {
     this.Type = 1;
     this.Name = name;
     this.Web  = web;
 }