guzzle/guzzle3 — pull request #15 by bradfeehan (2014-03-19 03:44:25+00:00)
Title: Fix OauthPlugin query aggregation always being default

This is the same as guzzle/guzzle#596, but submitted to the correct repository for Guzzle 3. Here's what I wrote there describing the issue:

> 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...

I took @mtdowling's advice, and this time avoided a `QueryString::getAggregator()` method. Instead I clone the entire `QueryString` from the request, then replace its data with the parameters to be signed.

It's a bit dirty as it unnecessarily subjects the `oauth_*` parameters to the query aggregation strategy of the request's `QueryString`. However, there should be no effects of this -- because these never have arrays as their value, they will never be subjected to aggregation anyway. If this approach is also undesirable, I'll probably need to hand the implementation over to a maintainer as I don't think I'll have the time to do a more significant refactoring.