Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* lib/parkplace/s3.rb: Change how content-md5 matches to follow Amaz…

…on's formats (base64 encoded digest instead of hexdigest).
  • Loading branch information...
commit c9fb178a6c962bec5e6f743f998d6efe4e211740 1 parent 39c21c1
stopdropandrew authored _why committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/parkplace/s3.rb
View
4 lib/parkplace/s3.rb
@@ -115,11 +115,11 @@ def put(bucket_name, oid)
fileinfo.mime_type = @env.HTTP_CONTENT_TYPE || "binary/octet-stream"
fileinfo.disposition = @env.HTTP_CONTENT_DISPOSITION
fileinfo.size = readlen
- fileinfo.md5 = md5.hexdigest
+ fileinfo.md5 = Base64.encode64(md5.digest).strip
raise IncompleteBody if @env.HTTP_CONTENT_LENGTH.to_i != readlen
if @env.HTTP_CONTENT_MD5
- raise InvalidDigest unless @env.HTTP_CONTENT_MD5 =~ /^[0-9a-fA-F]{32}$/
+ raise InvalidDigest unless @env.HTTP_CONTENT_MD5 =~ /^(?:[0-9a-zA-Z+\/]{4})*={0,2}$/
raise BadDigest unless fileinfo.md5 == @env.HTTP_CONTENT_MD5
end
Please sign in to comment.
Something went wrong with that request. Please try again.