Fix for Issue 320 re Rate Limit #321
Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Regex was wrong such that
GetStatusandGetUserwould both try to get an endpoint that didn't exist. The previous error catching failed, because anAttributeErrorwas never raised when trying to get a rate limit for an endpoint that didn't exist. SoGetStatuswas looking for rate limit information re/statuses/show/123, but the URL that method calls is just/statuses/show.jsonand the status_id is a query parameter. Same basic idea for/users/show/456v/users/show.jsonThis fixes that and amends the behavior to return a default rate limit object in the case that an endpoint is not found the first time around and then sets it the next time. This might cause some issues if Twitter consistently doesn't update their
/application/rate_limit_status.jsonendpoint, but I think we should cross that bridge when we come to it.This change is