CEF.swift : http status code remains at 0

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.

CEF.swift : http status code remains at 0

Postby Docgeo » Fri Mar 17, 2017 8:33 am

Hi,

Sorry if this post is not in the right place (it's a specific bindings support question), but there isn't any entry for CEF.swift.

I try to use CEF.swift, but I have a problem.
I use the project CEFDemo, and I want to use my own ResourceHandler. So I create this one :

Code: Select all
class XXXResourceHandler: CEFResourceHandler{
    func onProcessRequest(request: CEFRequest, callback: CEFCallback) -> CEFOnProcessRequestAction{
        print("XXXResourceHandler : onProcessRequest")
        callback.doContinue()
        return .allow
    }
   
    func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
        print("XXXResourceHandler : onGetResponseHeaders")
        response.status = 404
        response.statusText = "Not Found"
        print ("status after : " + String(response.status));
        print ("status text after : " + String(response.statusText));
        response.mimeType = "text/html"
        return .continueWithResponseLength(0)
    }
   
    func onReadResponse(buffer: UnsafeMutableRawPointer,bufferLength: Int, callback: CEFCallback) -> CEFOnReadResponseAction{
        print("XXXResourceHandler : onReadResponse")
       
        return .read(0)
    }
}

And on the response (CEFResponse), the value of the status doesn't change, only the statusText works :
Code: Select all
XXXResourceHandler : onProcessRequest
XXXResourceHandler : onGetResponseHeaders
status after : 0
status text after : Not Found


I tried with other status code value, it never works (and I see never the good status in chromium Dev Tools).
I tried with branch 2987, 2924 and 2743 : same problem.

Do you see any mistake ?

Thanks for your help,
Regards
Docgeo
Newbie
 
Posts: 2
Joined: Fri Mar 17, 2017 8:26 am

Re: CEF.swift : http status code remains at 0

Postby Docgeo » Mon Mar 20, 2017 3:48 am

Docgeo
Newbie
 
Posts: 2
Joined: Fri Mar 17, 2017 8:26 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 85 guests

cron