Skip to content

Commit 2fd1bbf

Browse files
committed
fix: treat http 403 as an updater error
Previously 403 was handled like 404 in the updater stating that no new update is available but that behavior is deemed incorrect in most cases so go-tuf will divert from python-tuf's behavior. Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
1 parent 7dec1ec commit 2fd1bbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

metadata/updater/updater.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,11 @@ func (update *Updater) loadRoot() error {
491491
// downloading the root metadata failed for some reason
492492
var tmpErr *metadata.ErrDownloadHTTP
493493
if errors.As(err, &tmpErr) {
494-
if tmpErr.StatusCode != http.StatusNotFound && tmpErr.StatusCode != http.StatusForbidden {
494+
if tmpErr.StatusCode != http.StatusNotFound {
495495
// unexpected HTTP status code
496496
return err
497497
}
498-
// 404/403 means current root is newest available, so we can stop the loop and move forward
498+
// 404 means current root is newest available, so we can stop the loop and move forward
499499
break
500500
}
501501
// some other error ocurred

0 commit comments

Comments
 (0)