From: Vibhav Pant <vibhavp@ubuntu.com>
To: 16498@debbugs.gnu.org
Subject: bug#16498: 24.3.50; Support for custom user agents in url.el
Date: Sun, 19 Jan 2014 21:21:43 +0530 [thread overview]
Message-ID: <CA+T2Sh1eVwkdM5rp=4xdDEntuyxy2sUx+1g9Y0q50m2vEw-YJw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 444 bytes --]
URL currently doesn't support custom user agents. This could be
implemented by adding a defcustom string url-user-agent which could be
changed by the
user.
The default value could be:
(format "User-Agent: %sURL/%s\r\n"
(if url-package-name
(concat url-package-name "/" url-package-version " ")
"") url-version)
I have attached a patch to add support for custom user agents in URL.
--
Vibhav Pant
vibhavp@gmail.com
[-- Attachment #2: url-custom-user-agent.patch --]
[-- Type: text/x-patch, Size: 1289 bytes --]
commit f380c64e2b3a6c892c8f2821b0d902cf5ca9d63d
Author: Vibhav Pant <vibhavp@gmail.com>
Date: Sun Jan 19 13:45:28 2014 +0000
Add support for custom user agent strings.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index ac2e140..6a0ec13 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -132,6 +132,15 @@ request.")
(507 insufficient-storage "Insufficient storage"))
"The HTTP return codes and their text.")
+(defcustom url-user-agent (format "User-Agent: %sURL/%s\r\n"
+ (if url-package-name
+ (concat url-package-name "/"
+ url-package-version " ")
+ "") url-version)
+ "User Agent used by the URL package."
+ :type 'string
+ :group 'url)
+
;(eval-when-compile
;; These are all macros so that they are hidden from external sight
;; when the file is byte-compiled.
@@ -214,11 +223,7 @@ request.")
(and (listp url-privacy-level)
(memq 'agent url-privacy-level)))
""
- (format "User-Agent: %sURL/%s\r\n"
- (if url-package-name
- (concat url-package-name "/" url-package-version " ")
- "")
- url-version)))
+ url-user-agent))
(defun url-http-create-request (&optional ref-url)
"Create an HTTP request for `url-http-target-url', referred to by REF-URL."
next reply other threads:[~2014-01-19 15:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-19 15:51 Vibhav Pant [this message]
2014-01-20 16:08 ` bug#16498: 24.3.50; Support for custom user agents in url.el Ted Zlatanov
2014-11-04 16:50 ` Ted Zlatanov
2014-11-05 15:27 ` Stefan Monnier
2014-11-05 16:09 ` Ted Zlatanov
2014-11-05 16:57 ` Glenn Morris
2014-11-05 17:04 ` Ted Zlatanov
2014-11-05 17:05 ` Glenn Morris
2014-11-05 17:40 ` Ted Zlatanov
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+T2Sh1eVwkdM5rp=4xdDEntuyxy2sUx+1g9Y0q50m2vEw-YJw@mail.gmail.com' \
--to=vibhavp@ubuntu.com \
--cc=16498@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.