umputun / remark42

comment engine
https://remark42.com
MIT License
4.77k stars 375 forks source link

Fix lack of error on file site export, improve lack of ADMIN_PASSWD error message #1734

Closed paskal closed 5 months ago

paskal commented 5 months ago

Previously, status 200 was set for file export, which is used for backup, which resulted in an inability to set an error status code in case of a problem with file generation.

After this change, status code 200 would be written automatically by Go before we start writing the response's body.

Also, add meaningful error for lack of auth on import, remap and backup.

Previously, the error printed was just the following:

error response "401 Unauthorized", Unauthorized"

New error:

error response "401 Unauthorized", ensure you have set ADMIN_PASSWD and provided it to the command you're running: Unauthorized
github-actions[bot] commented 5 months ago

Pull Request Test Coverage Report for Build 7686355908


Files with Coverage Reduction New Missed Lines %
backend/app/rest/api/rss.go 1 83.33%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 7596391691: 0.1%
Covered Lines: 5972
Relevant Lines: 7036

💛 - Coveralls