kopia lustrzana https://github.com/gaul/s3proxy
Unwrap AuthorizationException to ACCESS_DENIED
rodzic
5c3b4494d2
commit
224bb8b2f6
|
@ -293,6 +293,13 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
return;
|
return;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
if (Throwables2.getFirstThrowableOfType(throwable,
|
if (Throwables2.getFirstThrowableOfType(throwable,
|
||||||
|
AuthorizationException.class) != null) {
|
||||||
|
S3ErrorCode code = S3ErrorCode.ACCESS_DENIED;
|
||||||
|
sendSimpleErrorResponse(request, response, code,
|
||||||
|
code.getMessage(), ImmutableMap.<String, String>of());
|
||||||
|
baseRequest.setHandled(true);
|
||||||
|
return;
|
||||||
|
} else if (Throwables2.getFirstThrowableOfType(throwable,
|
||||||
TimeoutException.class) != null) {
|
TimeoutException.class) != null) {
|
||||||
S3ErrorCode code = S3ErrorCode.REQUEST_TIMEOUT;
|
S3ErrorCode code = S3ErrorCode.REQUEST_TIMEOUT;
|
||||||
sendSimpleErrorResponse(request, response, code,
|
sendSimpleErrorResponse(request, response, code,
|
||||||
|
|
Ładowanie…
Reference in New Issue