bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-u


From: Lars Ingebrigtsen
Subject: bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt
Date: Wed, 15 May 2019 07:36:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Sean Allred <allred.sean@gmail.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]