Menu

#294 Support for handling zipped content from http server

Latest SVN
closed
None
5
2012-10-21
2005-07-25
No

Hi,

I have a requirement where the server is returning a
zipped HTML/XML pages in response. Currently those
are not handled in HTMLUnit framework.

I have changed the 1.6 code to support this functionality
partly. I will be more than happy to review/contribute the
changes in.

I will appreciate the faster response, so I dont have to
keep merging my changes into the new releases of
HTMLUnit.

Thanks
Ritesh

Discussion

  • Marc Guillemot

    Marc Guillemot - 2005-07-26

    Logged In: YES
    user_id=402164

    I think that it is an interesting improvement. Can you
    provide your patch against the latest CVS version?

     
  • Ritesh Trivedi

    Ritesh Trivedi - 2005-10-21

    Zipped response patch files - 5 file diff

     
  • Ritesh Trivedi

    Ritesh Trivedi - 2005-10-21

    Logged In: YES
    user_id=804228

    Hi Marc,

    I have attached the patch files. I have added required method
    to MockWebConnection.java file (I still need to add
    corresponding test method in HttpWebConnection.java) but
    dont know how to run the unit tests. Can you either tell me
    how to run the test or add the test for me ?

    Thanks

     
  • Marc Guillemot

    Marc Guillemot - 2005-10-25

    Logged In: YES
    user_id=402164

    I really don't understand why the changes leak to classes
    for html elements. Compression only concerns the web
    connection and should be handled automatically before
    creating the WebResponseData or perhaps better BY the
    WebResponseData.

     
  • Ritesh Trivedi

    Ritesh Trivedi - 2005-10-25

    Logged In: YES
    user_id=804228

    Marc,

    The reason why you see changes in the html elements is
    becoz I have provided an overloaded method to WebClient
    with boolean flag for uncompress, the value of uncompress
    needs to be passed onto calls which return Page.

    I guess the other way would be to add an attribute to
    WebResponse data which should be set from
    WebClient/WebConnection and embed logic in
    WebResponseData to uncompress the response.

    What do you think?

     
  • Marc Guillemot

    Marc Guillemot - 2005-10-26

    Logged In: YES
    user_id=402164

    I really think that this feature only concern the
    WebConnection and the WebResponseDate (+possibly the WebClient).
    Basically, what we need is to have the possibility to add
    request headers like:
    Accept-Encoding: gzip,deflate

    and to understand compressed answers.
    Comparing it with a real browser: the browser can or cannot
    (most can) handle compressed content. You never click on a
    link an say: "get the page compressed".

     
  • Daniel Gredler

    Daniel Gredler - 2005-12-12

    Logged In: YES
    user_id=1109422

    Ritesh -

    Can you comment on why a user might not want the zipped
    response to be decompressed? The patch seems to imply that
    this is the case...

    Thanks!

     
  • Marc Guillemot

    Marc Guillemot - 2006-08-23

    Logged In: YES
    user_id=402164

    Now fixed in SVN thanks to patch from Daniel Gredler.
    gzipped content is now automatically expanded.

     

Log in to post a comment.