slowapi icon indicating copy to clipboard operation
slowapi copied to clipboard

feat: recursive search in subapps for handler

Open devamin opened this issue 1 year ago • 2 comments

Middleware application rate limit was not applied on sub application handlers, I added a recursive search for handlers of sub apps so that they get caught in middleware ratelimit as well.

devamin avatar Mar 13 '23 20:03 devamin

@laurentS what do you think please ?

devamin avatar Mar 31 '23 22:03 devamin

Hi @devamin thanks for sending in this PR!

A couple of thoughts:

  • mypy is complaining in CI, can you check what the problem is?
  • does it seem like supporting submounted routes for starlette as well would be a good idea?
  • are all recursive calls guaranteed to terminate? This is called on each request, so we should take care not to make this call too expensive :)

laurentS avatar Apr 03 '23 13:04 laurentS