Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use session.deserialize to unpack message for rate limiting #5

Merged
merged 1 commit into from
Jan 21, 2016

Conversation

minrk
Copy link

@minrk minrk commented Jan 21, 2016

rather than hardcoding json.loads, which fails on Python 3.5

Messages should never be deserialized by any means other than the Session API.

rather than hardcoding json.loads

Messages should **never** be deserialized by any means other than the Session API.
@jdfreder
Copy link
Owner

Ah interesting, I was doing this earlier but kept running into an error because I tried to deserialize the same message twice (duplicate signatures). I didn't think to change the base method like you do here.

jdfreder added a commit that referenced this pull request Jan 21, 2016
use session.deserialize to unpack message for rate limiting
@jdfreder jdfreder merged commit cc6aaf8 into jdfreder:ratelimit Jan 21, 2016
@minrk
Copy link
Author

minrk commented Jan 21, 2016

If need be, you could use session.unpack to unpack a single frame (I vacillated on whether I should do that here). But that's still putting an assumption about the wire format in code that shouldn't have it.

@minrk minrk deleted the limiter branch January 21, 2016 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants