Reputation: 13
I have an API with Oauth2 authentication developed with Symfony framework. I use the security mechanism provided by Symfony and my security.yml is as follows :
security:
...
register:
pattern: ^/users
methods: [POST]
...
api:
pattern: ^/
fos_oauth: true
stateless: true
As you can see, a new user is registered by the POST request /users. But my problem is that another POST request with URL like /users/xxxx matches the rule too. Is it possible to reject URLs with the same root ? Thanks for help.
Upvotes: 1
Views: 2168
Reputation: 1379
Please add $
sign at the end, pattern: ^/users$
should work.
Upvotes: 1