ocis
ocis copied to clipboard
[sharing-ng] status code for multiple mount and unmount share
Describe the bug
Mounting the share multiple times results in 400
status code. BUt this request isn't a bad request but conflict in request and thus should be 409. As RFC states in https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.8
The 409 (Conflict) status code indicates that the request could not
be completed due to a conflict with the current state of the target
resource.
Same goes for unmounting share multiple times. At the moment, oCIS returns 424
failed dependency status code. MDN docs writes
The HTTP 424 Failed Dependency client error response code indicates that the method could not be performed on the resource because the requested action depended on another action, and that action failed.
What are the appropriate status code for these two request?
Steps to reproduce
1.Login to ocis as admin
2.create a folder test
and share to einstein
3. click disable sync.
4. Send API request to mount resource.
5. send the request again to mount resource
curl -X POST 'https://host.docker.internal:9200/graph/v1beta1/drives/{share-Space-Id}/root/children'
-d '{
"remoteItem": {
"id":"'item-id"
}
}' -ueinstein:relativity