Continue even when a server replies with 403

Amazon S3 replies with a 403 when accessing files that don't exist,
while this should be fixed at Amazon, we can workaround it in aptly
for the moment.
This commit is contained in:
Rohan Garg
2014-10-25 21:41:57 +02:00
parent 7be2ef8b85
commit 140a11c04a

View File

@@ -318,7 +318,7 @@ func DownloadTryCompression(downloader aptly.Downloader, url string, expectedChe
}
if err != nil {
if err1, ok := err.(*HTTPError); ok && err1.Code == 404 {
if err1, ok := err.(*HTTPError); ok && err1.Code == 404 || err1.Code == 403 {
continue
}
return nil, nil, err