mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
30c8cf9248
Get basic CefStreamResourceHandler compiling Add headers and status codes to ResourceHandler
30 lines
716 B
C#
30 lines
716 B
C#
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
using System.Collections.Specialized;
|
|
using System.IO;
|
|
|
|
namespace CefSharp
|
|
{
|
|
public class ResourceHandler
|
|
{
|
|
public string MimeType { get; set; }
|
|
public Stream Stream { get; set; }
|
|
public int StatusCode { get; set; }
|
|
public string StatusText { get; set; }
|
|
public NameValueCollection Headers { get; set; }
|
|
|
|
public ResourceHandler()
|
|
{
|
|
StatusCode = 200;
|
|
StatusText = "OK";
|
|
}
|
|
|
|
public static ResourceHandler FromFileName(string fileName)
|
|
{
|
|
return new ResourceHandler { Stream = File.OpenRead(fileName) };
|
|
}
|
|
}
|
|
}
|