This change preserves the query path when constructing a public client and makes sure the redirect_uri is correctly passed in the client id when using a localhost client.
Without this, only / is accepted as a redirect path which prohibits anything other than the root path from working with localhost_client