Closed vishwas-trivedi closed 5 years ago
Section 9.9.4 of RFC4918 states that MOVE should return either 201, 204, 207, 403, 409, 412, 423 or 502. It can also return one of the general status codes, so the spec is not completely clear. Do you encounter issues with this result?
Hi Ramon, Thank you for the quick response!
Yes, I am facing problem with this, I would be grateful if you could let me know about following:
// We should always move the item from a parent container
var splitSourceUri = RequestHelper.SplitUri(request.Url);
var sourceCollection = await store.GetCollectionAsync(splitSourceUri.CollectionUri, httpContext).ConfigureAwait(false);
if (sourceCollection == null)
{
// Source not found
response.SetStatus(DavStatusCode.NotFound);
return true;
}
I think it's better to return 404 if the source file doesn't exist. The reason why I explicitly check for the source collection is to avoid for null
reference issues. If the parent doesn't exists, then the source collection would be null
and I cannot attempt to fetch the moved item.
See also pull request #53
Hello Ramon, Thank you for the quick response.
I've confirmed the operation with the branch's code, the problem has been resolved. Could you please merge it to master?
It has been merged to master and v0.1.34 has been pushed to NuGet.
Problem Description
Move request of a non-existing files returns Status: 207(Multi-Status) instead of 404(Not Found). Though I was able to confirm that Multi-Status response contains 404(Not Found) as an inner response as following :
Reproduction Procedure
Make a move request where source file does not exist.
Question
Is this intended behaviors or is it a bug?