Subject: Re: bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 15 May 2019 07:36:19 +0200

Sean Allred <[email-masked]> writes:

> Just a small typo, it seems.  In `url-auth.el' at
>
>     (setq user (or
>                 (url-do-auth-source-search server type :user)
>                 (read-string (url-auth-user-prompt url realm)   ; <-- here
>                              (or user (user-real-login-name))))
>           pass (or
>                 (url-do-auth-source-search server type :secret)
>                 (read-passwd "Password: " nil (or pass ""))))
>
> `url` should be `href`.

Man, the naming convention in that function is a mess.  `url' is
possibly a string (but can also be an URL object), while `href' is the
real URL object, which is...  backwards.

> This will prevent a type-mismatch when calling `url-basic-auth` as
>
>     (url-basic-auth "http://my.api.com" t)
>
> The workaround for this bug is calling it as
>
>     (url-basic-auth (url-generic-parse-url "http://my.api.com") t)
>
> This function should be inspected for other such bugs, but this is the
> only one I've come across personally.

There were two instances of the same confusion in that function.  I've
now pushed a fix according to your suggestion to Emacs 27.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no