matheusgomes28 / urchin

Headless CMS written in Golang
MIT License
60 stars 19 forks source link

Investigate why we can remove a post twice #77

Open matheusgomes28 opened 4 months ago

matheusgomes28 commented 4 months ago

Hitting the delete post endpoint (such as /posts/5) in the admin app succeeds multiple times. This should not happen as multiple deletions shouldn't work!

AlDu2407 commented 3 months ago

Hi @matheusgomes28 according to the specification of the HTTP protocol the DELETE operation is idempotent and therefore should be able to call DELETE endpoints multiple times. Although, the return code can change the endpoint should behave in an idempotent manner.

image

Ref: https://developer.mozilla.org/en-US/docs/Glossary/Idempotent

matheusgomes28 commented 3 months ago

Hey @AlDu2407 , that's fine but the issue is that it succeeds more than once - implying that we're not retuning a 404 on the second time