timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
426 stars 125 forks source link

put is too clever for some files #17

Closed midendian closed 10 years ago

midendian commented 12 years ago

Due to this magic: if (/^(?:x-amz-|Cache-|Content-|Expires:|If-|Range:)/i)

you can't have files named, for example, if-i-only-had-a-brain.txt. (Or, in my case, dealing with an ill-advised base64 alphabet.)

Would adding a special argument '--' to indicate "treat the remaining argv as files" make it less surprising?

timkay commented 12 years ago

Good point. For the record, this code catches arguments that are intended to be MIME headers. It's really useful to specify headers in lots of contexts.

Maybe the solution is to disallow this feature for the last argument, which should be the filename. Of course, it still precludes bucket names starting with if-...

...Tim

timkay commented 12 years ago

I think the right solution is to make sure the argument has a colon and space in it. Then you still can't have objects named certain things, but they are really specific.