[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
- Help understanding the URL code, Clément Pit--Claudel, 2016/04/05
- Re: Help understanding the URL code, Andreas Schwab, 2016/04/05
- Re: Help understanding the URL code,
Lars Magne Ingebrigtsen <=
- Re: Help understanding the URL code, Clément Pit--Claudel, 2016/04/07
- Re: Help understanding the URL code, Lars Magne Ingebrigtsen, 2016/04/07
- Re: Help understanding the URL code, Andreas Schwab, 2016/04/07
- Re: Help understanding the URL code, Lars Magne Ingebrigtsen, 2016/04/07
- Re: Help understanding the URL code, Yuri Khan, 2016/04/07
- Re: Help understanding the URL code, Andreas Schwab, 2016/04/07
- Re: Help understanding the URL code, Stefan Monnier, 2016/04/07
- Re: Help understanding the URL code, Andreas Schwab, 2016/04/07
- Re: Help understanding the URL code, Stefan Monnier, 2016/04/07
- Re: Help understanding the URL code, Andreas Schwab, 2016/04/07