Enable different CORS for different users #1918
-
I am working on API project, i need to know the best way to enable different CORS for different users. For example: users that have a Free plan will have only access to the API if their requests come from localhost or 127.0.0.1, and users that use Premium plan will have access from any server(computer). |
Beta Was this translation helpful? Give feedback.
Answered by
alex-oleshkevich
Nov 18, 2022
Replies: 1 comment 2 replies
-
You need a custom CORS middleware. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It could be something like this. Note, I didn't run this, but you should get the idea: