Bird
0
0

What will be the effect of this Flask-Limiter configuration?

medium📝 component behavior Q5 of 15
Flask - Security Best Practices
What will be the effect of this Flask-Limiter configuration?
limiter = Limiter(app, key_func=get_remote_address, default_limits=['10 per hour'])

on all routes without specific limits?
ANo limits will apply unless specified on routes
BAll routes will allow up to 10 requests per hour per client
CAll routes will allow unlimited requests
DOnly POST requests will be limited
Step-by-Step Solution
Solution:
  1. Step 1: Understand default_limits parameter

    default_limits applies the given limit to all routes without specific decorators.
  2. Step 2: Interpret the limit '10 per hour'

    Each client IP can make 10 requests per hour on any route by default.
  3. Final Answer:

    All routes will allow up to 10 requests per hour per client -> Option B
  4. Quick Check:

    default_limits apply globally = 10 per hour [OK]
Quick Trick: default_limits apply to all routes without overrides [OK]
Common Mistakes:
MISTAKES
  • Thinking limits apply only if route decorator used
  • Assuming unlimited requests by default
  • Believing only POST requests are limited

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes