mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Only set ResourceHandlerWrapper values if we plan to continue, if we Cancel they would be ignored
This commit is contained in:
@@ -36,16 +36,6 @@ namespace CefSharp
|
||||
|
||||
void ResourceHandlerWrapper::ProcessRequestCallback(IResourceHandlerResponse^ response, bool cancel)
|
||||
{
|
||||
_mime_type = StringUtils::ToNative(response->MimeType);
|
||||
_stream = response->ResponseStream;
|
||||
_statusCode = response->StatusCode;
|
||||
_statusText = StringUtils::ToNative(response->StatusText);
|
||||
_redirectUrl = StringUtils::ToNative(response->RedirectUrl);
|
||||
_contentLength = response->ContentLength;
|
||||
_closeStream = response->CloseStream;
|
||||
|
||||
_headers = TypeConversion::ToNative(response->ResponseHeaders);
|
||||
|
||||
// If CEF has canceled the initial request, throw away a response that comes afterwards.
|
||||
if (_callback != nullptr)
|
||||
{
|
||||
@@ -55,6 +45,16 @@ namespace CefSharp
|
||||
}
|
||||
else
|
||||
{
|
||||
_mime_type = StringUtils::ToNative(response->MimeType);
|
||||
_stream = response->ResponseStream;
|
||||
_statusCode = response->StatusCode;
|
||||
_statusText = StringUtils::ToNative(response->StatusText);
|
||||
_redirectUrl = StringUtils::ToNative(response->RedirectUrl);
|
||||
_contentLength = response->ContentLength;
|
||||
_closeStream = response->CloseStream;
|
||||
|
||||
_headers = TypeConversion::ToNative(response->ResponseHeaders);
|
||||
|
||||
_callback->Continue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user