Handle blank password in basic auth.
My only issue with this is that now options.auth.pass will behave differently from options.auth.password. However, there's already a similar issue with options.auth.user vs options.auth.username, so I'm not sure how much this matters. @mikeal, care to comment?
@nylen that's true. Are password and username legacy options? If so it would make sense to map them on the shorter fields, if they're present. I can't imagine that people use both at the same time. So, something like
if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) options.auth.user = options.auth.username
if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) options.auth.pass = options.auth.password
No need to care about legacy options after this.
Handle `auth.password` and `auth.username`.
I agree. Personally I would have gone with typeof options.auth.username != 'undefined', but I'd merge it either way.
typeof options.auth.username != 'undefined'
I put the alias names in there so that you could use either variant, without having to refer back to the docs to remember the naming convention.
How about that? Last commit?
Much cleaner, thanks!
for some reason Travis is complaining about tests failing with optionals enabled/disbled or something. i have no idea what that means.
Tests pass locally (for me, at least).
me too :)