SetHeaderMap - Check failed: false. object is read only

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

SetHeaderMap - Check failed: false. object is read only

Postby Staxcelrom » Sun Jun 19, 2022 12:45 pm

Hello,

I'm trying to replace Http request headers in OnBeforeResourceLoad using SetHeaderMap.

I do like this:

Code: Select all
   virtual CefResourceRequestHandler::ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, CefRefPtr<CefCallback> callback) override
        {
                 CefRequest::HeaderMap headerMap;                 
                (*request).GetHeaderMap(headerMap);

                (*request).SetHeaderMap(headerMap);
        }



The first few calls to OnBeforeResourceLoad work fine, the headers are actually replaced.

But, about 4 calls to OnBeforeResourceLoad - an error occurs in SetHeaderMap:

[0619/213618.476:FATAL:request_impl.cc(276)] Check failed: false. object is read only


But why ? What's wrong ? Why suddenly "object only for reading"?
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am

Re: SetHeaderMap - Check failed: false. object is read only

Postby magreenblatt » Sun Jun 19, 2022 2:23 pm

What URL are you loading? What request causes the error?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: SetHeaderMap - Check failed: false. object is read only

Postby Staxcelrom » Sun Jun 19, 2022 3:23 pm

I'm sorry, strange, but now the problem is not reproduced.
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 39 guests