S3Sync.net
February 02, 2014, 01:19:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Should use Content-MD5 header on PUT  (Read 8126 times)
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« on: June 23, 2008, 02:25:46 PM »

Especially in light of http://developer.amazonwebservices.com/connect/thread.jspa?threadID=22709
Logged
tienshiao
Newbie
*
Posts: 3


View Profile WWW
« Reply #1 on: July 24, 2008, 03:14:41 AM »

I've added support for the Content-MD5 header. It seems to work OK for me.

Edit: in case people missed it, the patch is attached to the reply. You might need to be logged in to see it.
« Last Edit: July 24, 2008, 04:00:19 PM by tienshiao » Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #2 on: July 24, 2008, 05:01:29 PM »

Warning: the patch is backwards.
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #3 on: July 24, 2008, 05:05:55 PM »

Is there any reason you have done
Quote
Base64.encode64(md5.digest)

rather than
Quote
md5.hexdigest

or maybe I don't understand the difference properly..?
Logged
tienshiao
Newbie
*
Posts: 3


View Profile WWW
« Reply #4 on: July 24, 2008, 05:45:47 PM »

Oops, sorry about the backwards patch.

hexdigest returns the MD5 in hexidecimal representation [0-9A-F].

Amazon's docs specify Content-MD5 should be in base64 (http://en.wikipedia.org/wiki/Base64) .



In hindsight, there probably isn't a need for the commandline switch (--content-md5). There isn't a good reason not to use Content-MD5 if you're already calculating the MD5.
« Last Edit: July 24, 2008, 05:48:07 PM by tienshiao » Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #5 on: July 25, 2008, 05:02:39 PM »

I agree about the switch.  I know I need to add this feature.
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #6 on: July 29, 2008, 12:47:02 AM »

When I add this, I want it to be compatible with the --no-md5 option, so that when a transfer is needed it will calculate the md5 anyway (but not bother for just comparing the two trees)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!