diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-04T13·20+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-04T13·20+0200 |
commit | ff08306746e88e708612cdc6d2dac84bd76f1106 (patch) | |
tree | 9063adfae9515e74810edc2b55f3b48eb73b9422 | |
parent | bc2e43f3c826eea5b92a4f255eee59c3bb253cbc (diff) |
download-from-binary-cache.pl: Treat a 403 error as a 404
Amazon S3 returns HTTP status code 403 if a file doesn't exist and the user has no permission to list the contents of the bucket. So treat it as 404 (meaning it's cached in the NARExistence table).
-rw-r--r-- | scripts/download-from-binary-cache.pl.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 4ca494497edc..1b4215278321 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -288,7 +288,7 @@ sub processNARInfo { my ($storePath, $cache, $request) = @_; if ($request->{result} != 0) { - if ($request->{result} != 37 && $request->{httpStatus} != 404) { + if ($request->{result} != 37 && $request->{httpStatus} != 404 && $request->{httpStatus} != 403) { print STDERR "could not download ‘$request->{url}’ (" . ($request->{result} != 0 ? "Curl error $request->{result}" : "HTTP status $request->{httpStatus}") . ")\n"; } else { @@ -467,7 +467,7 @@ sub printSubstitutablePaths { foreach my $request (values %requests) { if ($request->{result} != 0) { - if ($request->{result} != 37 && $request->{httpStatus} != 404) { + if ($request->{result} != 37 && $request->{httpStatus} != 404 && $request->{httpStatus} != 403) { print STDERR "could not check ‘$request->{url}’ (" . ($request->{result} != 0 ? "Curl error $request->{result}" : "HTTP status $request->{httpStatus}") . ")\n"; } else { |