Subject: bug#16498: closed (Re: bug#16498: 24.3.50; Support for custom user agents in url.el)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 05 Nov 2014 16:10:04 +0000

Your bug report

#16498: 24.3.50; Support for custom user agents in url.el

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16498: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16498
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16498: 24.3.50; Support for custom user agents in url.el
From: Ted Zlatanov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], Vibhav Pant <[email-masked]>
Date: Wed, 05 Nov 2014 11:09:06 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

On Wed, 05 Nov 2014 10:27:50 -0500 Stefan Monnier <[email-masked]> 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

Subject: 24.3.50; Support for custom user agents in url.el
From: Vibhav Pant <[email-masked]>
To: [email-masked]
Date: Sun, 19 Jan 2014 21:21:43 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

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
[email-masked]
commit f380c64e2b3a6c892c8f2821b0d902cf5ca9d63d
Author: Vibhav Pant <[email-masked]>
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."