litl/rauth — pull request #35 by joelverhagen (2012-08-21 19:18:41+00:00)
Title: Fixed invalid oflyApiSig when no params are passed

Consider the following case in `OflyService._sha1_sign_params` ([source](https://github.com/litl/rauth/blob/6780e21795d3c53ebd3cc3824b973a4dd2454766/rauth/service.py#L160-166)):

If the `params` argument passed to `_sha1_sign_params` is empty, `_sort_params` will return an empty string at [line 164](https://github.com/litl/rauth/blob/6780e21795d3c53ebd3cc3824b973a4dd2454766/rauth/service.py#L164). This will result in an invalid query string (an ampersand immediately after the question mark, e.g. `...?&...`).

This is obviously result in an invalid hash. I have confirmed the problem on the Shutterfly API.

For the curious: the [Shutterfly API](http://www.shutterfly.com/documentation/OflyCallSignature.sfly) provides a detailed description of how to generate the hash. Look under the heading **Signature Generation Details**.