Skip to content

Commit

Permalink
[Symfony][Router] Set the default method for a route to "GET"
Browse files Browse the repository at this point in the history
* I always sspecify the method(s) in my route declaration and it's boring
* Allowing by default all methods does not make sens
* Allowing by default all methods can be a security issue, because
  someone can DDOS the application by sending POST request, to a
  resource that is usually cached (but only for GET)
* explicit is better than implicit
  • Loading branch information
lyrixx committed Jan 11, 2024
1 parent 0ff0a0a commit 0683d88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions symfony/routing/6.2/config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ controllers:
path: ../src/Controller/
namespace: App\Controller
type: attribute
methods: [GET]

0 comments on commit 0683d88

Please sign in to comment.