[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: url-http does not propagate redirected URL as callback argument
From: |
Thierry Emery |
Subject: |
Re: url-http does not propagate redirected URL as callback argument |
Date: |
Thu, 26 May 2005 10:20:02 +0200 |
User-agent: |
T-gnus/6.17.3 (based on No Gnus v0.3) SEMI/1.14.6 (Maruoka)FLIM/1.14.7 (Sanjō) APEL/10.6 Emacs/22.0.50 (gnu/linux) MULE/5.0 (SAKAKI) |
I wrote:
> url-retrieve is called on a "directory" URL without the ending "/" (and
> a callback function). The Web server returns a redirection status
> (e.g. "301") and the full URL (with the ending "/").
> url-http-parse-headers calls url-retrieve with the redirected URL as
> first argument, but this redirected URL is not passed on as a callback
> argument. The callback function is then called with the original URL
> (without the ending "/"). As a consequence, any relative URLs inside
> the retrieved document are misinterpreted by the calling package.
>
> The following patch fixes this problem:
Sorry, the previous patch was incorrect, it would cause problems in packages
that needed more than one callback argument. Please find below a corrected
patch.
Thierry
--- /usr/local/share/emacs/22.0.50/lisp/url/url-http.el 2005-02-14
10:58:33.000000000 +0100
+++ url-http.el 2005-05-26 10:18:22.000000000 +0200
@@ -500,7 +500,9 @@
(url-request-data url-http-data)
(url-request-extra-headers url-http-extra-headers))
(url-retrieve redirect-uri url-callback-function
- url-callback-arguments)
+ (cons redirect-uri
+ (and url-callback-arguments
+ (cdr url-callback-arguments))))
(url-mark-buffer-as-dead (current-buffer))))))
(4 ; Client error
;; 400 Bad Request