Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

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.

$this->_webhookId = $id;
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);
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants