dlecocq / nsq-py

Hacking on Python NSQ Bindings
MIT License
44 stars 16 forks source link

fix for nsq 1.0 new json response #51

Closed mathieulongtin closed 6 years ago

mathieulongtin commented 6 years ago

The latest NSQ 1.0 servers don't put all the JSON inside a "data" element. So if "data" is not there, assume the whole json is the response.

Before: {"data":{actual answer},...}. It had other field like http exit code, which you can get from the response header. After: {actual answer]

This fix is backward compatible

dlecocq commented 6 years ago

LGTM. If you include a version bump, I can publish this to pypi as well

mathieulongtin commented 6 years ago

Done. Thanks.

dlecocq commented 6 years ago

Released on pypi

mathieulongtin commented 6 years ago

Thanks!