Add an EmptyResponseFilterTest example - cannot seem to trigger the response filter just yet

This commit is contained in:
amaitland
2016-02-11 15:33:14 +10:00
parent 92f2fac35d
commit 0962e6c46b
+10 -1
View File
@@ -89,6 +89,15 @@ namespace CefSharp.Example
return true;
}
if (string.Equals(fileName, "/EmptyResponseFilterTest.html", StringComparison.OrdinalIgnoreCase))
{
stream = null;
mimeType = "text/html";
callback.Continue();
return true;
}
string resource;
if (ResourceDictionary.TryGetValue(fileName, out resource) && !string.IsNullOrEmpty(resource))
{
@@ -118,7 +127,7 @@ namespace CefSharp.Example
public Stream GetResponse(IResponse response, out long responseLength, out string redirectUrl)
{
responseLength = stream.Length;
responseLength = stream == null ? 0 : stream.Length;
redirectUrl = null;
response.StatusCode = (int)HttpStatusCode.OK;