Closed glpatcern closed 1 year ago
@glpatcern, I am interested in this task and would start looking at it. It would be great if you could answer the following queries: 1 - Do you want this change to be in every file? 2 - Can you provide me with an example area in the code where this change is needed?
@osamaahmed17 feel free, just consider that this year we are not hosting any GSoC student.
@glpatcern, I know about that. I have more time nowadays to work open source. Plus, it would be great that if you can answer my above queries so I can work upon it.
1 - Do you want this change to be in every file?
More than in every file, this concerns every server response, therefore the most affected source file is src/core/wopi.py
.
2 - Can you provide me with an example area in the code where this change is needed?
A typical case is https://github.com/cs3org/wopiserver/blob/master/src/core/wopi.py#L496, where a better response would be some "standard" JSON like {"message" : "<the error message>"}
along with the http error code.
Currently in case of errors we return a raw text string most of the time in the HTTP Body, along with the HTTP status code (which is what matters for the WOPI apps). JSON is used only in some specific cases, e.g.
PutRelative
.It would be good to ensure JSON is used all over the places, and in addition some standard response headers could be added from https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/common-headers#response-headers