headbase-app / headbase

The customizable database for your brain. Note-taking, task-management, personal knowledge bases and more.
https://headbase.app
GNU Affero General Public License v3.0
1 stars 0 forks source link

Server returning content type of application/json when no JSON is returned #25

Open ben-ryder opened 4 hours ago

ben-ryder commented 4 hours ago

Describe the bug The server is currently returning content type of application/json in some situations when no JSON is returned, for example the logout endpoint does this:

res.status(HttpStatusCodes.OK).json(response);

This is not correct, as response is always void in this scenario. In these cases the server should use sendStatus instead and should not send application/json as the content type.
This is causing difficulty when writing a client which can automatically detect and parse the response data based on the content type headers.