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

Clean-up middleware #22325

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Clean-up middleware #22325

wants to merge 7 commits into from

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Apr 26, 2024

Scope

  • Some middleware were unnecessarily async - these have been updated now, which might lead to a tiny performance improvement
  • Consistent naming, named exports
  • Prevent shadowing of async middleware return type with RequestHandler type
  • return next() instead of next() at end of middleware for sake of consistency
  • Move "handlers" to respective places, keep global "middlewares" only in /middleware folder
  • Move rateLimiterGlobal and rateLimiterIp instances to own files (use... pattern)
  • Remove checks in cors, rateLimiterGlobal and rateLimiterIp middlewares as already in app.ts
  • A few smaller enhancements

Potential Risks / Drawbacks

No logical changes

Review Notes / Questions

None

This comment was marked as off-topic.

@hanneskuettner

This comment was marked as resolved.

@paescuj

This comment was marked as resolved.

@paescuj paescuj marked this pull request as draft May 9, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Needs Triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants