diff --git a/CHANGELOG.md b/CHANGELOG.md index b08a8069..bd2a5f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Exports created with `s3_urls` now contain valid URLs. * Exports no longer fail with "The requested range is not satisfiable". +* Requests requiring authentication, but lack a provided access token, will return HTTP 401 instead of HTTP 500 now. ## [1.3.3] - October 31, 2023 diff --git a/api/_routers/98-use-rcontext.go b/api/_routers/98-use-rcontext.go index 6a3b8e9f..3111b2c8 100644 --- a/api/_routers/98-use-rcontext.go +++ b/api/_routers/98-use-rcontext.go @@ -205,6 +205,9 @@ beforeParseDownload: } if errRes, isError := res.(*_responses.ErrorResponse); isError && proposedStatusCode == http.StatusOK { switch errRes.InternalCode { + case common.ErrCodeMissingToken: + proposedStatusCode = http.StatusUnauthorized + break case common.ErrCodeUnknownToken: proposedStatusCode = http.StatusUnauthorized break