unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Help understanding the URL code
Date: Wed, 06 Apr 2016 13:34:44 +0200	[thread overview]
Message-ID: <m3lh4r0y3v.fsf@gnus.org> (raw)
In-Reply-To: <5703DBB2.1030903@gmail.com> ("Clément Pit--Claudel"'s message of "Tue, 5 Apr 2016 16:37:22 +0100")

Clément Pit--Claudel <clement.pit@gmail.com> writes:

> Thus IIUC this bit of code will return different values depending on
> whether the url package had already been loaded before or whether it
> was loaded through url-retrieve-synchronously being autoloaded. Is
> that right?

Yes, you're right, and that doesn't make much sense.

Your patch looks good, but perhaps this part could be changed a bit:

[...]

> +    (format "User-Agent: %s\r\n"
> +            (string-trim
> +             (cond
> +              ((functionp url-user-agent) (funcall url-user-agent))
> +              ((stringp url-user-agent) url-user-agent)
> +              (t (url-http--user-agent-default-string)))))))

It should be possible to not have a User-Agent header at all.  nil as a
value to `url-user-agent' would be the obvious choice, and `default'
could be the value to signal using `url-http--user-agent-default-string'.

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



  parent reply	other threads:[~2016-04-06 11:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 15:37 Help understanding the URL code Clément Pit--Claudel
2016-04-05 16:54 ` Andreas Schwab
2016-04-06 11:34 ` Lars Magne Ingebrigtsen [this message]
2016-04-07 11:02   ` Clément Pit--Claudel
2016-04-07 12:32     ` Lars Magne Ingebrigtsen
2016-04-07 12:53       ` Andreas Schwab
2016-04-07 13:01         ` Lars Magne Ingebrigtsen
2016-04-07 13:02         ` Yuri Khan
2016-04-07 13:13           ` Andreas Schwab
2016-04-07 13:22             ` Stefan Monnier
2016-04-07 13:32               ` Andreas Schwab
2016-04-07 14:17                 ` Stefan Monnier
2016-04-07 14:28                   ` Andreas Schwab
2016-04-07 15:37                     ` Stefan Monnier
2016-04-07 16:28               ` John Wiegley
2016-04-07 13:07         ` Stefan Monnier
2016-04-07 14:20           ` Drew Adams
2016-04-07 21:18             ` Richard Stallman
2016-04-07 17:00       ` Clément Pit--Claudel
2016-04-24 12:51         ` Lars Magne 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=m3lh4r0y3v.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=clement.pit@gmail.com \
    --cc=emacs-devel@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).