Trouble receiving gzip encoded data when using custom

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.

Trouble receiving gzip encoded data when using custom

Postby perlun » Wed Aug 28, 2013 10:15 am

Hi,

For some really obscure reasons which we'd rather not try to elaborate upon here (trust me, you really do not want to know... :) ) I need to override the CEF/Chromium built-in http/https download mechanism, so that Windows integration can fully work. (Yes, I know it "kind of" works but the problem is I have an utterly evil web page which only works in IE, not in Chrome or Cef. :( )

The actual Windows integration part isn't so hard (since I'm using CefSharp and my app is .NET based); I can quite easily make NTLM/Kerberos-authenticated requests. That part I think I've already got working. The troublesome part is that when I return the data (by means of a scheme handler registered using CefRegisterSchemeHandlerFactory) _almost_ everything works fine... except that, for some crazy reason, Chromium does not detect that my response is gzip encoded.

(I also tried to do it first with the OnBeforeResourceLoad() approach which had similar results. It didn't work even though I noted in the Chrome dev tools that the HTTP response seemingly had the proper Content-Encoding header set.)

Actually, from looking at it a bit more right now, it seems like our CefSchemeHandler might not be completely sane. This *could* be causing the problem. Anyway, if someone has experience specifically with gzip encoded content while using some form of custom scheme (be it a proper CefSchemeHandler or just some OnBeforeResourceLoad hack), I'd be very glad to hear your story. TIA.
perlun
Techie
 
Posts: 23
Joined: Tue Jul 23, 2013 11:30 am

Re: Trouble receiving gzip encoded data when using custom

Postby ray007 » Wed Mar 14, 2018 4:07 am

This still does not seem to work.
I think the problem is the missing "Accept-Encoding" request header.
Anything I can do so CEF does send one of those?
Then I only need to make CefSharp do it too...
ray007
Techie
 
Posts: 10
Joined: Wed Aug 26, 2015 10:37 am

Re: Trouble receiving gzip encoded data when using custom

Postby magreenblatt » Wed Mar 14, 2018 1:36 pm

ray007 wrote:This still does not seem to work.
I think the problem is the missing "Accept-Encoding" request header.
Anything I can do so CEF does send one of those?
Then I only need to make CefSharp do it too...

What specifically doesn't work? With what OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Trouble receiving gzip encoded data when using custom

Postby ray007 » Thu Mar 15, 2018 2:58 am

magreenblatt wrote:
ray007 wrote:This still does not seem to work.
I think the problem is the missing "Accept-Encoding" request header.
Anything I can do so CEF does send one of those?
Then I only need to make CefSharp do it too...

What specifically doesn't work? With what OS and CEF version?


When serving a gzip-compressed file to the client, even adding a header "Content-Encoding: gzip" does not cause the browser to decompress the file.
I'm assuming it has something to do with there not being a request-header "Accept-Encoding: gzip".
Tested on Win7 64bit with CEF versions 57 and now 63, wrapped in CefSharp.
ray007
Techie
 
Posts: 10
Joined: Wed Aug 26, 2015 10:37 am

Re: Trouble receiving gzip encoded data when using custom

Postby magreenblatt » Thu Mar 15, 2018 12:33 pm

Correct, gzip decoding is not implemented for content returned via custom scheme handlers.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Trouble receiving gzip encoded data when using custom

Postby ray007 » Fri Mar 16, 2018 4:18 am

magreenblatt wrote:Correct, gzip decoding is not implemented for content returned via custom scheme handlers.

Any special reason or just not enough people asking for it?
ray007
Techie
 
Posts: 10
Joined: Wed Aug 26, 2015 10:37 am

Re: Trouble receiving gzip encoded data when using custom

Postby magreenblatt » Fri Mar 16, 2018 12:34 pm

ray007 wrote:
magreenblatt wrote:Correct, gzip decoding is not implemented for content returned via custom scheme handlers.

Any special reason or just not enough people asking for it?

Because it doesn't make sense. The traffic is not going over the network so you don't need compression to save bandwidth. You're just wasting CPU cycles by using it.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Trouble receiving gzip encoded data when using custom

Postby ray007 » Mon Mar 19, 2018 4:49 am

magreenblatt wrote:
ray007 wrote:
magreenblatt wrote:Correct, gzip decoding is not implemented for content returned via custom scheme handlers.

Any special reason or just not enough people asking for it?

Because it doesn't make sense. The traffic is not going over the network so you don't need compression to save bandwidth. You're just wasting CPU cycles by using it.

My app consumes gzip-encoded xml data, so I do need a gunzip anyway.
Doing it in the browser instead of before pushing the data into the ipc-channel would seem to be more efficient to me, but I can make it work this way too.
ray007
Techie
 
Posts: 10
Joined: Wed Aug 26, 2015 10:37 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 41 guests