Automattic / knox

S3 Lib
MIT License
1.74k stars 285 forks source link

Escape question marks in filenames #268

Closed hurrymaplelad closed 9 years ago

hurrymaplelad commented 9 years ago

Depends on #267.

S3 allows objects with ? in the key. This PR makes it easier to get at them. Some S3 endpoints (like bulk delete) make use of query params. The ? separating them from the file key should not be escaped. To get this behavior, client.request(url, ...) no longer escapes special characters in its URL argument, while client.get(), .post(), and friends do. You might think of .request() as lower level. With this distinction, the earlier fix from b5bf86026923744 is no longer needed.

Again, surfaced by a filepicker upload of a file with a question mark in the name.

domenic commented 9 years ago

Really excellent PR. You clearly took the time to figure out a good solution, and write and run tests. Much appreciated. Will do a release shortly.