ciaranj/node-oauth — pull request #193 by DavidTPate (2014-05-06 18:37:47+00:00)
Title: Handle Authorization URL With Already Existing Query Parameter

Hi there! I'm using this library for one of my projects and ran into an instance where I had an authorization end-point similar to the following: `http://www.example.com/oauth2/authorize?parameter1=value1` where I was hitting an issue when attempting to build the Authorization URL since it was creating the following: `http://www.example.com/oauth2/authorize?parameter1=value1?response_type=code&redirect_uri=REDIRECT_URI&client_id=CLIENT_ID` which is an invalid URL (specifically the `?parameter1=value1?response_type=code` part.

To address this I've added a simple check for the Authorization URL already having the `?` in it which fixed this issue for me. I'm not aware of anywhere else in the OAuth2 spec (specifically the client side) where query parameters already existing on a URL would cause an issue so I've only update the single line.