mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
Add an EmptyResponseFilterTest example - cannot seem to trigger the response filter just yet
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user