guzzle/guzzle — pull request #387 by Danack (2013-07-24 14:55:08+00:00)
Title: Oauth optional variables

Hi Michael,

Here is the fix to stop null values being added to the list of parameters that need to be signed by oauth, as well as an extra test to stop them from being accidentally added again.

I removed the duplication of code in onRequestBeforeSend and getParamsToSign. However this does have a side effect of making the parameters in the Authorization header not be in alphabetical order. I think this ok as the spec doesn't say that the Authorization header must have it's parameters in order (http://tools.ietf.org/html/rfc5849#section-3.5.1), it's only when the signature is calculated that the params are done in order.

So I also changed the test 'testSignsOauthRequests()' so that the string tests is not hard coded to be in a specific order, but just checks for all the required elements anywhere in the string.

I think the above is correct and shouldn't cause issues, but thought I'd better draw your attention to it.

cheers
Dan