-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hello @hfiguiere,
this is a question for you..
TLDR:
- What is the expected response body format for a WOPI request (e.g. check file info) in case of failure? (access denied, bad token, not found). Is a json response ok? (given that we set the correct http response code)
- What would be the desired behavior of the Collabora editor, if a CheckFileInfo request returns access denied?
About WOPI 403 response
Currently the WopiController sends its own "Access denied" response which is:
- Content: 'Authentication failed.' (just text, no json, no html)
- Http status code: 403
- Headers: Content-type: text/plain
We would like to refactor this so that access handling happens in the router, not in the controller. This will open up more possibilities and help to organize the code better.
If we do this, the default 403 response would be a full html page.
But, we can change it so that we get a json response like {"message": "Sorry, xyz"}.
I did not find anything in the Microsoft WOPI or Collabora Online documentation that gives more information on the expected response format in case of no access or error. Microsoft says which http response code to set (they say 401 or 404), but nothing about the content, see https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response
I assume the response body can be anything, so json would be ok too.
About the editor behavior
Currently when I artificially let the WopiController send an 403, 404 or 401, the editor is stuck forever in "Initializing...".
Is this intentional? Was it always this way, or did we damage something?
Was there a way to make the editor show "Sorry, you cannot edit this file" or "This file was not found"?