* bug#16498: 24.3.50; Support for custom user agents in url.el
@ 2014-01-19 15:51 Vibhav Pant
2014-01-20 16:08 ` Ted Zlatanov
0 siblings, 1 reply; 9+ messages in thread
From: Vibhav Pant @ 2014-01-19 15:51 UTC (permalink / raw)
To: 16498
[-- 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."
^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-01-19 15:51 bug#16498: 24.3.50; Support for custom user agents in url.el Vibhav Pant
@ 2014-01-20 16:08 ` Ted Zlatanov
2014-11-04 16:50 ` Ted Zlatanov
0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2014-01-20 16:08 UTC (permalink / raw)
To: Vibhav Pant; +Cc: 16498
On Sun, 19 Jan 2014 21:21:43 +0530 Vibhav Pant <vibhavp@ubuntu.com> wrote:
VP> URL currently doesn't support custom user agents. This could be
VP> implemented by adding a defcustom string url-user-agent which could be
VP> changed by the
VP> user.
VP> The default value could be:
VP> (format "User-Agent: %sURL/%s\r\n"
VP> (if url-package-name
VP> (concat url-package-name "/" url-package-version " ")
VP> "") url-version)
VP> I have attached a patch to add support for custom user agents in URL.
I think this makes sense, but it has to wait until after the feature
freeze.
Ted
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-01-20 16:08 ` Ted Zlatanov
@ 2014-11-04 16:50 ` Ted Zlatanov
2014-11-05 15:27 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2014-11-04 16:50 UTC (permalink / raw)
To: Vibhav Pant; +Cc: 16498
On Mon, 20 Jan 2014 11:08:11 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote:
TZ> On Sun, 19 Jan 2014 21:21:43 +0530 Vibhav Pant <vibhavp@ubuntu.com> wrote:
VP> URL currently doesn't support custom user agents. This could be
VP> implemented by adding a defcustom string url-user-agent which could be
VP> changed by the
VP> user.
VP> The default value could be:
VP> (format "User-Agent: %sURL/%s\r\n"
VP> (if url-package-name
VP> (concat url-package-name "/" url-package-version " ")
VP> "") url-version)
VP> I have attached a patch to add support for custom user agents in URL.
TZ> I think this makes sense, but it has to wait until after the feature
TZ> freeze.
Stefan, can you please look at this patch? It would also help with
#18812 which requests the ability to specify a more detailed User-Agent
string.
Ted
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-11-04 16:50 ` Ted Zlatanov
@ 2014-11-05 15:27 ` Stefan Monnier
2014-11-05 16:09 ` Ted Zlatanov
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2014-11-05 15:27 UTC (permalink / raw)
To: Vibhav Pant; +Cc: 16498
VP> I have attached a patch to add support for custom user agents in URL.
TZ> I think this makes sense, but it has to wait until after the feature
TZ> freeze.
> Stefan, can you please look at this patch?
I haven't looked in detail, but I'm all in favor of such a feature in trunk.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-11-05 15:27 ` Stefan Monnier
@ 2014-11-05 16:09 ` Ted Zlatanov
2014-11-05 16:57 ` Glenn Morris
0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2014-11-05 16:09 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 16498-done, Vibhav Pant
On Wed, 05 Nov 2014 10:27:50 -0500 Stefan Monnier <monnier@iro.umontreal.ca> wrote:
VP> I have attached a patch to add support for custom user agents in URL.
TZ> I think this makes sense, but it has to wait until after the feature
TZ> freeze.
>> Stefan, can you please look at this patch?
SM> I haven't looked in detail, but I'm all in favor of such a feature in trunk.
I added it (with an option to use a function call); marking this as
done and I hope you find it useful.
Ted
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-11-05 16:09 ` Ted Zlatanov
@ 2014-11-05 16:57 ` Glenn Morris
2014-11-05 17:04 ` Ted Zlatanov
0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2014-11-05 16:57 UTC (permalink / raw)
To: 16498; +Cc: tzz
Could you add a :version tag for the defcustom and a NEWS entry please?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#16498: 24.3.50; Support for custom user agents in url.el
2014-11-05 16:57 ` Glenn Morris
@ 2014-11-05 17:04 ` Ted Zlatanov
2014-11-05 17:05 ` Glenn Morris
0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2014-11-05 17:04 UTC (permalink / raw)
To: Glenn Morris; +Cc: 16498
On Wed, 05 Nov 2014 11:57:04 -0500 Glenn Morris <rgm@gnu.org> wrote:
GM> Could you add a :version tag for the defcustom and a NEWS entry please?
Right, sorry. Would this be sufficient?
=== modified file 'etc/NEWS'
--- etc/NEWS 2014-11-03 22:27:26 +0000
+++ etc/NEWS 2014-11-05 17:03:40 +0000
@@ -226,6 +226,10 @@
When `url-handler-mode' is enabled, file operations for these
protocols as well as for "telnet" and "ftp" are passed to Tramp.
+** The URL package allows customizing the `url-user-agent' string.
+The new `url-user-agent' variable can be customized to be a string or
+a function.
+
** Tramp
*** New connection method "nc", which allows to access dumb busyboxes.
=== modified file 'lisp/url/url-http.el'
--- lisp/url/url-http.el 2014-11-05 16:06:40 +0000
+++ lisp/url/url-http.el 2014-11-05 17:02:31 +0000
@@ -140,6 +140,7 @@
"User Agent used by the URL package."
:type '(choice (string :tag "A static User-Agent string")
(function :tag "Call a function to get the User-Agent string"))
+ :version "25.1"
:group 'url)
;(eval-when-compile
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-11-05 17:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-19 15:51 bug#16498: 24.3.50; Support for custom user agents in url.el Vibhav Pant
2014-01-20 16:08 ` 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
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.