Code written in WopiFileRepository.cs in function UpdateFileContent having following code
if (!file.IsLocked){if (stream.Length > 0)return new Tuple<HttpStatusCode, string>(HttpStatusCode.Conflict, string.Empty);}else{if (!file.IsSameLock(lockValue))return new Tuple<HttpStatusCode, string>(HttpStatusCode.Conflict, file.LockValue);}
The if condition that checks Length of stream should actually check length of current file instead of incoming request per documentation here....
http://wopi.readthedocs.io/projects/wopirest/en/latest/files/PutFile.html
When a host receives a PutFile request on a file that is not locked, the host must check the current size of the file. If it is 0 bytes, the PutFile request should be considered valid and should proceed. If it is any value other than 0 bytes, or is missing altogether, the host should respond with a 409 Conflict.
So the host should return 200 instead of 409 every time.
Code written in
WopiFileRepository.cs
in functionUpdateFileContent
having following codeif (!file.IsLocked)
{
if (stream.Length > 0)
return new Tuple<HttpStatusCode, string>(HttpStatusCode.Conflict, string.Empty);
}
else
{
if (!file.IsSameLock(lockValue))
return new Tuple<HttpStatusCode, string>(HttpStatusCode.Conflict, file.LockValue);
}
The if condition that checks Length of stream should actually check length of current file instead of incoming request per documentation here.... http://wopi.readthedocs.io/projects/wopirest/en/latest/files/PutFile.htmlWhen a host receives a PutFile request on a file that is not locked, the host must check the current size of the file. If it is 0 bytes, the PutFile request should be considered valid and should proceed. If it is any value other than 0 bytes, or is missing altogether, the host should respond with a 409 Conflict.
So the host should return 200 instead of 409 every time.