Beispiel #1
0
        public static void WriteHeaders(IHttpWriter writer, IFubuFile file)
        {
            var mimeType = MimeType.MimeTypeByFileName(file.Path);

            if (mimeType != null)
            {
                writer.AppendHeader(HttpResponseHeaders.ContentType, mimeType.Value);
            }

            writer.AppendHeader(HttpResponseHeaders.LastModified, file.LastModified().ToString("r"));
            writer.AppendHeader(HttpResponseHeaders.ETag, file.Etag().Quoted());
        }
Beispiel #2
0
        public override void Write(IHttpWriter writer)
        {
            WriteHeaders(writer, _file);

            if (_status == HttpStatusCode.OK)
            {
                writer.AppendHeader(HttpResponseHeaders.ContentLength, _file.Length().ToString());
            }

            writer.WriteResponseCode(_status);
        }
Beispiel #3
0
 public void AppendHeader(string header, string value)
 {
     _writer.AppendHeader(header, value);
 }
Beispiel #4
0
 public void Replay(IHttpWriter writer)
 {
     writer.AppendHeader(Name, Value);
 }
Beispiel #5
0
 public void Replay(IHttpWriter writer)
 {
     writer.AppendHeader(Name, Value);
 }