modified: cloudbridge/src/com/cloud/bridge/service/S3RestServlet.java

modified:   cloudbridge/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java
	modified:   cloudbridge/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineResponse.java
This commit is contained in:
JohnZ 2012-04-19 19:24:11 +01:00 committed by Salvatore Orlando
parent 542a399957
commit d4e81ab525
4 changed files with 9 additions and 4 deletions

0
agent/scripts/_run.sh Normal file → Executable file
View File

View File

@ -157,8 +157,8 @@ public class S3RestServlet extends HttpServlet {
}
catch(Throwable e) {
logger.error("Unexpected exception " + e.getMessage(), e);
response.setStatus(500);
endResponse(response, "Internal server error");
response.setStatus(400);
endResponse(response, "Bad request");
} finally {
try {

View File

@ -129,7 +129,7 @@ public class S3ObjectAction implements ServletAction {
else executePutObject(request, response);
}
else if ( null != (copy = request.getHeader( "x-amz-copy-source" )))
{
{
executeCopyObject(request, response, copy.trim());
}
else executePutObject(request, response);
@ -454,6 +454,8 @@ public class S3ObjectAction implements ServletAction {
// they are not HTTP request headers). All the values we used to get in the request headers
// are not encoded in the request body.
//
// add ETag header computed as Base64 MD5 whenever object is uploaded or updated
//
public void executePostObject( HttpServletRequest request, HttpServletResponse response ) throws IOException
{
String bucket = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY);

View File

@ -31,8 +31,11 @@ public class S3PutObjectInlineResponse extends S3Response {
uploadId = -1;
}
// add ETag header computed as Base64 MD5 whenever object is uploaded or updated
// the Base64 is represented in lowercase
public String getETag() {
return ETag;
return ETag.toLowerCase();
}
public void setETag(String eTag) {