oauth/oauth-ruby — pull request #65 by nikz (2012-11-11 21:09:58+00:00)
Title: Fix adding paths when a full URL has been specified

When you create a consumer similar to the following:

```ruby
@consumer = OAuth::Consumer.new(
"key",
"secret",
{
:site => "https://api.mysite.co.nz/v1",
:request_token_url => "https://authentication.mysite.co.nz/Oauth/RequestToken"
})
```

Then currently the #get_request_token method will send a request to:

http://authentication.mysite.co.nz/v1/Oauth/RequestToken

(Note the extra "v1" path)

This is due to this line:

https://github.com/oauth/oauth-ruby/blob/master/lib/oauth/consumer.rb#L337

This patch:

* Changes that functionality so that it's only active if the current http host and the URI host match
* Adds a test for the broken case

All the tests pass, so I don't think I've missed anything but let me know if I have and I'll be happy to update the PR.

Thanks!

Nik