public void WriteTo(HttpListenerResponse destination) { destination.Cookies = Source.Cookies; destination.Headers = Source.Headers; destination.ContentType = Source.ContentType; destination.StatusCode = Source.StatusCode; destination.WriteBytes(Source.ToBytes()); }
protected virtual void OnFileFound(string filePath, HttpListenerResponse response) { Log("Client requested file ({0})... Found", filePath); var file = File.ReadAllBytes(filePath); response.ContentType = GetContentType(filePath); response.WriteBytes(file); }