guzzle/guzzle — pull request #596 by bradfeehan (2014-03-18 06:54:09+00:00)
Title: Fix OauthPlugin query aggregation always being default

When using `OauthPlugin` for a request with a non-default query aggregator set (e.g. `CommaAggregator`), it creates invalid OAuth signatures. This is because it uses the default query aggregator to construct the "string to sign". The string to sign then contains the query string parameters in a different format to the actual query string of the request:

Request URI: http://example.com/test?a=b,c,d
OAuth string to sign (un-escaped): GET&http://example.com/test&a[0]=b&a[1]=c&a[2]=d...

To fix it, I copy the aggregator from the request to the `QueryString` instance used to build the string to sign. There was no `getAggregator` on the `QueryString` class so I had to add this. I decided against adding a test for this new getter as it's very simple.

I notice that the `OauthPlugin` class is no longer in the `master` branch, due to the upcoming Guzzle 4 which won't include this plugin in core. So I branched off from the `v3.8.1` tag instead. I'd love to get this merged into a patch version in 3.x (so maybe 3.8.2), because I'm not keen to try upgrading to Guzzle 4 immediately, but this is a blocker for me at the moment. To do this you could simply tag 47b80f658d8654b29a2df6a5feb15d457c874dd4 as `v3.8.2`, and then close this pull request. But it's up to you!