Fail V4 signature requests with InvalidArgument

This allows V4 clients like s3cmd to retry with V2 signatures.
References #24.
pull/31/head
Andrew Gaul 2015-01-05 13:26:47 -08:00
rodzic 0eac109276
commit ff551248a1
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -207,6 +207,12 @@ final class S3ProxyHandler extends AbstractHandler {
}
headerIdentity = values[0];
headerSignature = values[1];
} else if (headerAuthorization != null &&
headerAuthorization.startsWith("AWS4-HMAC-SHA256 ")) {
// Fail V4 signature requests to allow clients to retry with V2.
sendSimpleErrorResponse(response, S3ErrorCode.INVALID_ARGUMENT);
baseRequest.setHandled(true);
return;
}
String parameterIdentity = request.getParameter("AWSAccessKeyId");
String parameterSignature = request.getParameter("Signature");