From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Klaus Straubinger Newsgroups: gmane.emacs.devel Subject: url-http.el: redirection to partial URL with a proxy Date: Mon, 14 Nov 2005 16:11:01 +0100 (CET) Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1131981384 10791 80.91.229.2 (14 Nov 2005 15:16:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2005 15:16:24 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 14 16:16:21 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ebg00-0005CZ-PW for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 16:12:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ebfzz-0003MM-TF for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 10:11:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbfzB-00038o-Pp for emacs-devel@gnu.org; Mon, 14 Nov 2005 10:11:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ebfz8-00037B-Kf for emacs-devel@gnu.org; Mon, 14 Nov 2005 10:11:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ebfz8-00036u-CJ for emacs-devel@gnu.org; Mon, 14 Nov 2005 10:11:06 -0500 Original-Received: from [155.56.68.170] (helo=smtpde02.sap-ag.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ebfz4-0002IG-33 for emacs-devel@gnu.org; Mon, 14 Nov 2005 10:11:06 -0500 Original-Received: from sap-ag.de (smtpde02) by smtpde02.sap-ag.de (out) with ESMTP id QAA13268 for ; Mon, 14 Nov 2005 16:10:59 +0100 (MEZ) Original-To: emacs-devel@gnu.org Content-Language: en-GB X-Mailer: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 X-SAP: out X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45956 Archived-At: The redirection of a URL retrieval request to a partial (not fully qualified) URL does not work if the retrieval is attempted with a proxy connection. The function url-http-parse-headers in url-http.el constructs a fully qualified URL by using the variable url-current-object. But this variable contains the proxy URL if a proxy is used. This leads to a wrong redirection URL. The following patch solves this problem. It works because url-http-cookies-sources contains always the original URL as set in the function url-http. Maybe the variable could be renamed because it is useful not just for cookie handling. --- url-http.el.orig 2005-10-21 09:21:56.000000000 +0200 +++ url-http.el 2005-11-14 15:42:07.000000000 +0100 @@ -510,7 +510,9 @@ ;; non-fully-qualified URL (ie: /), which royally confuses ;; the URL library. (if (not (string-match url-nonrelative-link redirect-uri)) - (setq redirect-uri (url-expand-file-name redirect-uri))) + (setq redirect-uri + (url-expand-file-name redirect-uri + url-http-cookies-sources))) (let ((url-request-method url-http-method) (url-request-data url-http-data) (url-request-extra-headers url-http-extra-headers)) -- Klaus Straubinger