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 (); }
public Stream(Entity entity, Waser.IO.IByteStream stream) { HttpEntity = entity; SocketStream = stream; AddHeaders = true; }