Skip to content

Commit

Permalink
Fix object key problems in batch_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
rockuw committed Dec 23, 2015
1 parent 43760dc commit cd2e343
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/aliyun/oss/protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def batch_delete_objects(bucket_name, object_names, opts = {})
body << '<Delete>'
body << '<Quiet>' << (opts[:quiet]? true : false).to_s << '</Quiet>'
object_names.each { |k|
body << '<Object><Key>' << k << '</Key></Object>'
body << '<Object><Key>' << CGI.escapeHTML(k) << '</Key></Object>'
}
body << '</Delete>'

Expand Down
3 changes: 2 additions & 1 deletion tests/test_object_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def setup
simple: 'simple_key',
chinese: '杭州・中国',
space: '是 空格 yeah +-/\\&*#',
invisible: '' << 1 << 10 << 12 << 7,
invisible: '' << 1 << 10 << 12 << 7 << 80 << 99,
xml: 'a<b&c>d +'
}
end

Expand Down

0 comments on commit cd2e343

Please sign in to comment.