unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: 35688@debbugs.gnu.org
Subject: bug#35688: url-auth prompt is blank when realm is the empty string
Date: Sat, 11 May 2019 16:38:27 -0400	[thread overview]
Message-ID: <m3imugrakc.fsf@fitzsim.org> (raw)

Hi,

When a website returns an empty string for realm, url-get-authentication
prompts:

Username [for ]:

See for example:

(url-retrieve-synchronously "https://outlook.office365.com/EWS/Exchange.asmx")

The attached patch makes the prompt contain the full URL, and applies to
all auth schemes.  However, maybe each auth scheme should decide how to
handle a "" realm and to fix this particular case I should just change
url-basic-auth?  I'm open to suggestions.

Anyway, I'm filing this bug because I think prompting for a username and
password while not showing the user the requested URL is a usability
problem.

Thomas

diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index 0746cfd96c..f644787cc6 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -478,6 +478,8 @@ url-get-authentication
        if one cannot be found in the cache"
   (if (not realm)
       (setq realm (cdr-safe (assoc "realm" args))))
+  (if (equal realm "")
+      (setq realm nil))
   (if (stringp url)
       (setq url (url-generic-parse-url url)))
   (if (or (null type) (eq type 'any))





             reply	other threads:[~2019-05-11 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11 20:38 Thomas Fitzsimmons [this message]
2019-05-15  4:15 ` bug#35688: url-auth prompt is blank when realm is the empty string Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3imugrakc.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=35688@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).