Skip to content

Commit

Permalink
Fix M_MISSING_TOKEN HTTP status code (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Nov 25, 2023
1 parent b2f3c30 commit a32d068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions api/_routers/98-use-rcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a32d068

Please sign in to comment.