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

Unclear how to add middleware to a subset of routes #844

Closed
akdor1154 opened this issue Feb 24, 2020 · 1 comment
Closed

Unclear how to add middleware to a subset of routes #844

akdor1154 opened this issue Feb 24, 2020 · 1 comment

Comments

@akdor1154
Copy link

akdor1154 commented Feb 24, 2020

Middleware seems to be designed to apply to my app as a whole and not to certain routes.

Use case 1: I'd like to have CORS behaviour be different depending on which route gets hit (frontend or api). Presently this seems impossible (unless I'm mistaken?)
Use case 2: (you may consider this one to be a bit dodgy): I'd like to write my auth layer as a custom middleware and not using Starlette's Auth system, and I don't want to have to re-implement the @requires system.

EDIT: Sorry, looks like a dupe of #587 .

Important

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@tomchristie
Copy link
Member

Yeah we don't currently have any mechanism to support this.
Not really sure if we should, or what it would look like if we did.

Will close this in favour of #587 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants