mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
Do a little cleaning up of StreamAdapter to more effeciently deal with MemoryStreams, and add lame header to ResourceHandler usage in CefExample.cs.
Additionally, allocate Headers NameValueCollection in constructor.
This commit is contained in:
@@ -64,7 +64,9 @@ namespace CefSharp.Example
|
||||
if (handler != null)
|
||||
{
|
||||
const string responseBody = "<html><body><h1>Success</h1><p>This document is loaded from a System.IO.Stream</p></body></html>";
|
||||
handler.RegisterHandler(TestResourceUrl, ResourceHandler.FromString(responseBody));
|
||||
var response = ResourceHandler.FromString(responseBody);
|
||||
response.Headers.Add("HeaderTest1", "HeaderTest1Value");
|
||||
handler.RegisterHandler(TestResourceUrl, response);
|
||||
|
||||
const string unicodeResponseBody = "<html><body>整体满意度</body></html>";
|
||||
handler.RegisterHandler(TestUnicodeResourceUrl, ResourceHandler.FromString(unicodeResponseBody));
|
||||
|
||||
Reference in New Issue
Block a user