iScsc / iscsc.fr

The iScsc website, build with passion by wannabe devs 🔥
GNU General Public License v3.0
4 stars 12 forks source link

Fix backend header set twice #61

Closed atxr closed 1 year ago

atxr commented 1 year ago
atxr commented 1 year ago

@amtoine The function res.status or res.sendStatus can be used only once in a route. It basically sets the response headers. Here, without this return, this function might set the headers to 404 once and then still execute the remaining code, which will set the headers again at the end. So this return allows to quit the function when no author is provided.

amtoine commented 1 year ago

again, waiting a bit for @gbrivady :yum: @atxr, if you feel time has passed enough, just merge this :wink:

atxr commented 1 year ago

Shouldn't we wait for #66 before merging this one?

amtoine commented 1 year ago

Shouldn't we wait for #66 before merging this one?

imo, this is a bug fix so, even if it was not planned in the 0.1.1, it still is a bug fix and thus could go inside this patch version ... or after

in the end, that does not look like a big deal at all :wink: