From 140a11c04a4eb06ad2ccb41f4abcd2662faed5c6 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Sat, 25 Oct 2014 21:41:57 +0200 Subject: [PATCH 1/2] 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. --- http/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/download.go b/http/download.go index cbf096c0..0331273c 100644 --- a/http/download.go +++ b/http/download.go @@ -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 From 4c1d6d14631f65b831d676f3ca433e053c5828e6 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 26 Oct 2014 19:53:49 +0300 Subject: [PATCH 2/2] Fix operator precedence. #131 --- http/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/download.go b/http/download.go index 0331273c..e7167945 100644 --- a/http/download.go +++ b/http/download.go @@ -318,7 +318,7 @@ func DownloadTryCompression(downloader aptly.Downloader, url string, expectedChe } if err != nil { - if err1, ok := err.(*HTTPError); ok && err1.Code == 404 || err1.Code == 403 { + if err1, ok := err.(*HTTPError); ok && (err1.Code == 404 || err1.Code == 403) { continue } return nil, nil, err