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:
rassilon
2015-03-02 19:02:37 -05:00
parent c22abba259
commit a300631954
4 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -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));