mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-09 21:59:42 -06:00
fix: wopi lock header in get lock response
This commit is contained in:
5
changelog/unreleased/fix-get-lock-header.md
Normal file
5
changelog/unreleased/fix-get-lock-header.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Bugfix: Return wopi lock header in get lock response
|
||||
|
||||
We fixed a bug where the wopi lock header was not returned in the get lock response. This is now fixed and the wopi validator tests are passing.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10469
|
||||
@@ -147,8 +147,10 @@ func (f *FileConnector) GetLock(ctx context.Context) (*ConnectorResponse, error)
|
||||
Str("StatusCode", resp.GetStatus().GetCode().String()).
|
||||
Str("StatusMsg", resp.GetStatus().GetMessage()).
|
||||
Msg("GetLock failed with unexpected status")
|
||||
// TODO: Should we be more strict? There could be more causes for the failure
|
||||
return NewResponse(404), nil
|
||||
// Return 404 and the required header, even if it's empty
|
||||
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/getlock#response-headers
|
||||
// This is needed to fulfill the requirements of online WOPI validator
|
||||
return NewResponseWithLock(404, ""), nil
|
||||
}
|
||||
|
||||
lockID := ""
|
||||
|
||||
@@ -113,7 +113,7 @@ var _ = Describe("FileConnector", func() {
|
||||
response, err := fc.GetLock(ctx)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(response.Status).To(Equal(404))
|
||||
Expect(response.Headers).To(BeNil())
|
||||
Expect(response.Headers[connector.HeaderWopiLock]).To(Equal(""))
|
||||
})
|
||||
|
||||
It("Get lock success", func() {
|
||||
|
||||
Reference in New Issue
Block a user