Always call the completeAuth callback with a parsed url #116

Merged
merged 1 commit into from Dec 14, 2012

Conversation

Projects
None yet
2 participants
Contributor

maxpeterson commented Dec 6, 2012

If completeAuth is called with an authenticated url object then it calls the callback with the original unparsed url.

The following url object will result in the callback being called with the same url object.

{
    url: "http://USERNAME:PASSWORD@myjamjs.com//jam",
    search: "http://USERNAME:PASSWORD@myjamjs.com//jam/_search"
}

If the url requires authentication then it calls the callback with an already parsed url.
The following url object will result in the callback being called with the url 'http://myjamjs.com//jam'

{
    url: "http://myjamjs.com//jam",
    search: "http://USERNAME:PASSWORD@myjamjs.com//jam/_search"
}

In the case of the publish command this results in calling doPublish with a url object when it expects a string.

@maxpeterson maxpeterson Alway call completeAuth callback with parsed url.
If completeAuth is called with an authenticated url (e.g. 
`http://USERNAME:PASSWORD@myjamjs.com/jam`) it calls the callback with
the original unparsed url however if the url requires authentication
(e.g. `http://myjamjs.com/jam`) then it calls the callback with an
already parsed url.

In the case of the publish command this results in the calling doPublish with a
url object.
5401f30

caolan merged commit 533f9ea into caolan:master Dec 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment