Hello,
I'm currently working on a project using CEF and I stumbled upon the same kind of issue.
In my case, I try to add a new header parameter to the request (an authorization header with a Bearer token) before processing the ressource.
I added a custom client in the method 'CefBrowserHost::CreateBrowserSync' which is able to return a custom 'CefResourceRequestHandler' whose method 'OnBeforeResourceLoad' is overriden.
I can break inside the method (so the pipeline is working as expected), and the request HeaderMap is updated with my new header.
- Code: Select all
ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) override
{
CefRequest::HeaderMap map;
request->GetHeaderMap(map);
map.insert({CefString("Authorization"), CefString("Bearer xxxxxxxxxxxx")});
request->SetHeaderMap(map);
return RV_CONTINUE;
}
However, when I catch the request headers server-side, my 'Authorization' header parameter is not inside the map, hence my unauthenticated client.
Is there any way to check the final state of the request just before it is sent ?