[Top][All Lists]

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

Re: Help understanding the URL code

From: Lars Magne Ingebrigtsen
Subject: Re: Help understanding the URL code
Date: Wed, 06 Apr 2016 13:34:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Clément Pit--Claudel <address@hidden> 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

reply via email to

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