-
Notifications
You must be signed in to change notification settings - Fork 24
OPTIONS requests shouldn't be rate limited #71
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
Conversation
|
This looks easy enough to do. We can check the |
aren't rate limited Added tests
|
@ian-foote or @meshy Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to recreate the request each time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as the request is being processed items are popped from the data structure. So the request cannot be reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pity.
now only rate limits post
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add a helper method to make this more DRY. Something like:
def check_post_rate_limit(self, view, data, expected_status):
request = self.create_request('post', data=data, auth=False)
response = view(request)
self.assertEqual(response.status_code, expected_status)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@ian-foote Please take another look |
|
I moved it out with a look to adapting check_post_rate_limit() to work with different request types |
|
@meshy or @ian-foote could you take another look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would assert_post_returns_status be more appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Update |
|
Happy if travis is |
OPTIONS requests shouldn't be rate limited
Currently, refreshing a password reset request page (3 or more times) that does an
OPTIONSto get fields, will block you from requesting the fields for a day.We should only be rate limiting
POSTrequests.cc @meshy @ian-foote