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