by kbiskar » Tue Feb 03, 2015 6:00 pm
OnResourceRedirect does get triggered during this process (after the intial OnBeforeBrowse) however, I really wnat to modify the request once I find that it's a redirect.
To put this in context, we add special headers to requests for resources in specific domains. However, if one of those redirects from an approved domain to a non-approved domain, I want to remove the added headers so that we don't leak data to un-trusted sources. OnResourceResponse would work (if we check for a 302) except that by the time it hits, we've already leaked the data. OnResouceRedirect occurs at the right time, but there's no request object to work with. OnBeforeBrowse would work but there are issues. One is that the request is immutable, so we can't remove the headers. The workaround for that we cancel the request and call LoadUrl() on the new url which creates a new request where we don't add the headers in the first place. But without the new url in CEF3, I'll have to find another workaround.
I admit that this logic is more convoluted than it probably needs to be, so if you know an alternative, please let know. In general though, thanks for the quick updates and help.