diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2018-04-14 19:01:36 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2018-04-14 19:01:36 +0200 |
commit | 950a9b0f240a7ca63533296626bb746a4a4930b2 (patch) | |
tree | c92ee224088556c4220393b100fc7d8cf50e6e6d /lisp/url/url-http.el | |
parent | 0b0d3815da99f575b74e82234bfb963d89362152 (diff) | |
download | emacs-with-fetched-url.tar.gz |
Update with-url branch and rename to with-fetched-urlwith-fetched-url
Diffstat (limited to 'lisp/url/url-http.el')
-rw-r--r-- | lisp/url/url-http.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index d45bb323b12..bc88014612f 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -272,6 +272,12 @@ request.") (defun url-http-user-agent-string () "Compute a User-Agent string. The string is based on `url-privacy-level' and `url-user-agent'." + (let ((ua-string (url-http-user-agent))) + (if ua-string (format "User-Agent: %s\r\n" (string-trim ua-string)) ""))) + +(defun url-http-user-agent () + "Compute a User-Agent string. +The string is based on `url-privacy-level' and `url-user-agent'." (let* ((hide-ua (or (eq url-privacy-level 'paranoid) (and (listp url-privacy-level) @@ -281,8 +287,9 @@ The string is based on `url-privacy-level' and `url-user-agent'." (cond ((functionp url-user-agent) (funcall url-user-agent)) ((stringp url-user-agent) url-user-agent) - ((eq url-user-agent 'default) (url-http--user-agent-default-string)))))) - (if ua-string (format "User-Agent: %s\r\n" (string-trim ua-string)) ""))) + ((eq url-user-agent 'default) + (url-http--user-agent-default-string)))))) + ua-string)) (defun url-http-create-request () "Create an HTTP request for `url-http-target-url', using `url-http-referer' |