headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

Can't work with "gzip, deflate" #96

Open tutorial0 opened 6 years ago

tutorial0 commented 6 years ago

When add http.header like this:

head := http.Header{}
head.Set("Accept", "*/*")
head.Set("Accept-Encoding", "gzip, deflate")
head.Set("Connection", "keep-alive")
bow.SetHeadersJar(head)

Then method Body can only got garbled text like:

�Z�SW�<�W��Af����ĔF'�[)�jz���=v��C��D1�h⃨(����H4�A�Y�g�俰���s�l�R\�}���{��BߎG�?v�+c%�ا���d�D�@2y �;�A��a.�HqyMPtِUE(%�?�9

And many other method(like Title, Links) can't get expected results.

ziscky commented 6 years ago

Hi, I've submitted PR #104 for this. Pretty straightforward.