예제 #1
0
        public void Content(Waser.IContext context)
        {
            string path = context.Request.Path;
            Console.WriteLine(path);
            if (path.StartsWith ("/"))
                path = path.Substring (1);

            if (this.ValidFile (path))
            {
                context.Response.Headers.SetNormalizedHeader ("Content-Type", Waser.MimeTypes.GetMimeType (path));
                context.Response.SendFile (path);
            }
            else
                context.Response.StatusCode = 404;
            context.Response.End ();
        }
예제 #2
0
 public Stream(Entity entity, Waser.IO.IByteStream stream)
 {
     HttpEntity = entity;
     SocketStream = stream;
     AddHeaders = true;
 }