Support URL signing for multiple methods #7

Merged
merged 1 commit into from Oct 23, 2013

Conversation

Projects
None yet
2 participants
@chmhofer
Contributor

chmhofer commented Oct 23, 2013

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.

marsell added a commit that referenced this pull request Oct 23, 2013

Merge pull request #7 from chmhofer/preflighted_request_signing
Support URL signing for multiple methods

@marsell marsell merged commit d63d5b4 into joyent:master Oct 23, 2013

@marsell

This comment has been minimized.

Show comment Hide comment
@marsell

marsell Oct 23, 2013

Contributor

Looks good. Thanks for the fix. :)

Contributor

marsell commented Oct 23, 2013

Looks good. Thanks for the fix. :)

marsell pushed a commit that referenced this pull request Oct 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment