Closed midendian closed 10 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
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.
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?