-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
🚀 Feature: Restful appwrite function method restriction #6316
Comments
Why would you choose to not handle that from your function code? I get why you want to limit it, but if we start creating this kind of features directly in Appwrite wouldn't that become an endless list? Curious to understand the use case a bit better, and your thoughts about this level of abstraction vs flexibility you have today. |
I don't think it would become an endless list. :) Here are some reasons for this:
Also, if we don't do checks for HTTP method in the code, it means (I think) slightly less execution time. One of the best practices for cloud functions is have it do one thing, and do it good. Again, it would only be optional feature for those who want to use it and make further API restrictions without additional code. |
Interesting perspectives. Do you think we should focus only on the 4/5 method around REST or all HTTP methods? It's very important in this kind of decisions before we have a go/no-go moment to make sure we understand the full scope and have a clear framework for what should be and shouldn't be abstracted to keep the system complexity relatively low and make sure Appwrite is great for both beginners and senior developers. |
I forgot to mention PATCH method. But yes, understandable. I would also like to see more perspectives on this topic :) |
Here's my take on this :
if (req.method !== 'GET') return res.send("Only GET is allowed here", 405);
|
🔖 Feature description
Restriction on which method can restful appwrite function endpoint recieve.
🎤 Pitch
Restful methods are usually used like this:
It would be nice to be able to limit which of those can a Restful appwrite function endpoint recieve, and to return internal rest error if wrong method is sent.
Specifically, HTTP 405 - Method not allowed
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: