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

Rate limits #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Rate limits #13

wants to merge 2 commits into from

Conversation

Cmrickels
Copy link

Rate Limit Headers

Added a fix to return the rate limit headers as properties with the response object. The properties are 'limit', 'remaining_calls', and 'remaining_seconds'. Those names can be changed very easily on line 112, 113, and 114 according to preference.

Copy link

@johkelly johkelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to my other comments, I'd also like to see e8903e2 removed to prevent clutter on the git history.

return $this;
}

/**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal block should be reverted. We still want to expose the ability to set the webhook parameters.

preg_match_all('/X-Rate-Limit-.{0,}/',$this->response_json, $out, PREG_PATTERN_ORDER);
preg_match("/\d{1,}/",$out[0][0],$limit);
preg_match("/\d{1,}/",$out[0][1],$remaining);
preg_match("/\d{1,}/",$out[0][2],$reset);
Copy link

@johkelly johkelly Jan 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently dependent on the output order, is it not? This method of getting the headers is tolerable, but I'd prefer to see something more robust/explicit with regard to the header names and order.

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