Problem
When using a trailing slash in the key the slash gets lost.
s3client = Aws::S3::Client.new(...)
s3client.put_object(key: 'path/with/trailing/slash/', bucket: 'bucket', body: '')
Actual behavior
An empty object with key path/with/trailing/slash is created.
Expected behavior
Create an empty object with key path/with/trailing/slash/ (note the trailing slash).
Use case
The use case for this is s3fs. It uses empty objects with trailing slashes to mark directories. Due to this issue objects created with this sdk are unusable from s3fs.
Debugging
I managed to track down the problematic piece of code.
aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb, line 61:
param.split('/').map{ |value| escape(value) }.join('/')
This split-then-join loses the trailing slash.
Problem
When using a trailing slash in the key the slash gets lost.
Actual behavior
An empty object with key
path/with/trailing/slashis created.Expected behavior
Create an empty object with key
path/with/trailing/slash/(note the trailing slash).Use case
The use case for this is s3fs. It uses empty objects with trailing slashes to mark directories. Due to this issue objects created with this sdk are unusable from s3fs.
Debugging
I managed to track down the problematic piece of code.
aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb, line 61:This split-then-join loses the trailing slash.