Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Support URL signing for multiple methods #7
Motivation: CORS file upload (http://www.w3.org/TR/cors/)
Joyent Manta supports CORS file uploads via the PUT request when the directory has the required CORS headers. The browser will send it as a preflighted request, i.e., it will first send an OPTIONS, then a PUT request. In order for this to work, we have to generate a signed URL that is valid for both requests.
node-manta has support for generating such a signature, but ruby-manta so far doesn't. This pull-request adds this functionality to ruby-manta. Now, a list of methods can be passed to the "method" parameter of gen_signed_url, and :options is regarded an allowed method.
I have adapted the test, too. It demonstrates how it is supposed to be used.