FG-AI4H-TG-Symptom / fgai4h-tg-symptom-assessment-mmvb-backend

A backend of a minimal minimal viable benchmark designed and developed by the members of the sub-group (topic group) “Symptom assessment”, which is the part of the ITU focus group “Artificial Intelligence for Health”
6 stars 4 forks source link

`DELETE` requests with a missing trailing slash are redirected to `GET` #41

Closed neopostmodern closed 4 years ago

neopostmodern commented 4 years ago

Steps to reproduce:

  1. Trigger a request DELETE api/v1/benchmarking-sessions/0a9506b1-448a-4286-a4dc-67ab88b221d6
  2. Django logs:
    [20/Apr/2020 15:42:16] "DELETE /api/v1/benchmarking-sessions/0a9506b1-448a-4286-a4dc-67ab88b221d6 HTTP/1.1" 301 0
    [20/Apr/2020 15:42:16] "GET /api/v1/benchmarking-sessions/0a9506b1-448a-4286-a4dc-67ab88b221d6/ HTTP/1.1" 200 176

With a trailing slash it works:

  1. Trigger a request DELETE api/v1/benchmarking-sessions/0a9506b1-448a-4286-a4dc-67ab88b221d6/
  2. Django logs:
    [20/Apr/2020 15:49:45] "DELETE /api/v1/benchmarking-sessions/0a9506b1-448a-4286-a4dc-67ab88b221d6/ HTTP/1.1" 204 0

I think it should at least 404 rather than 301 to GET?

neopostmodern commented 4 years ago

Fixed in #43