ChimeraCoder / anaconda

A Go client library for the Twitter 1.1 API
MIT License
1.14k stars 247 forks source link

Automatically deflate based on Content-Encoding #179

Closed gaul closed 7 years ago

gaul commented 7 years ago

Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: https://github.com/golang/go/issues/18779

Fixes #170.

ChimeraCoder commented 7 years ago

Thanks!

Out of curiousity, do you know under which circumstances Twitter returns deflated responses?

gaul commented 7 years ago

Sorry I'm not exactly sure how I encountered this issue since I worked on it some months ago.

ChimeraCoder commented 7 years ago

No worries. Thanks again for the patch!

gaul commented 7 years ago

I reproduced the symptoms with this call:

2017/09/05 00:00:30 Could not authenticate: Get https://api.twitter.com/1.1/friends/list.json?cursor=1538070094339682341&tweet_mode=extended returned status 503, x��VJ-*�/*V���V�M-.NLOU�R�/K-RHN,HL�,�T�QJ�O
�������N
Gurpartap commented 6 years ago

I get deflate data responses randomly every so often. Thanks for the fix @gaul @ChimeraCoder !