From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#701: 23.0.60; url-http.el package should not rewrite POST to GET upon 301 reply Date: Wed, 13 Aug 2008 18:33:57 -0400 Message-ID: <87tzdoo88a.fsf@stupidchicken.com> Reply-To: Chong Yidong , 701@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218667660 12738 80.91.229.12 (13 Aug 2008 22:47:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 22:47:40 +0000 (UTC) Cc: 701@emacsbugs.donarmstrong.com To: thomas weidner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 14 00:48:32 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTP8p-0005fq-AE for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 00:48:31 +0200 Original-Received: from localhost ([127.0.0.1]:40297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTP7s-0001Cu-Ud for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Aug 2008 18:47:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTP7p-0001CH-I8 for bug-gnu-emacs@gnu.org; Wed, 13 Aug 2008 18:47:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTP7n-0001BK-IM for bug-gnu-emacs@gnu.org; Wed, 13 Aug 2008 18:47:28 -0400 Original-Received: from [199.232.76.173] (port=42481 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTP7n-0001BF-DL for bug-gnu-emacs@gnu.org; Wed, 13 Aug 2008 18:47:27 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52150) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KTP7n-0006wo-2L for bug-gnu-emacs@gnu.org; Wed, 13 Aug 2008 18:47:27 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7DMlPvv021911; Wed, 13 Aug 2008 15:47:25 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7DMe572019286; Wed, 13 Aug 2008 15:40:05 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 13 Aug 2008 22:40:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 701 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 701-submit@emacsbugs.donarmstrong.com id=B701.121866680417507 (code B ref 701); Wed, 13 Aug 2008 22:40:05 +0000 Original-Received: (at 701) by emacsbugs.donarmstrong.com; 13 Aug 2008 22:33:24 +0000 Original-Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7DMXLUd017501 for <701@emacsbugs.donarmstrong.com>; Wed, 13 Aug 2008 15:33:22 -0700 Original-Received: by cyd (Postfix, from userid 1000) id 6E5B657E311; Wed, 13 Aug 2008 18:33:57 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Wed, 13 Aug 2008 18:47:28 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19394 Archived-At: > when a 301 reply in url-http.el is received, requests other than GET > and HEAD are also rewritten to a GET request to the new location. This > is nearly always not what the user of the library > intended. (i.e. posting data to a url results in a GET to the new url > and the posted data is lost) The authors of url-http.el are aware of > the issue as some comments in the file show, but i think their > solution is wrong. The current behaviour is even stated as wrong in > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 > . Some ideas whould be not to issue a new request but leave the 301 to > the user or to issue the SAME request again. How about the following change? Does it work better? *** trunk/lisp/url/url-http.el.~1.60.~ 2008-07-02 07:14:37.000000000 -0400 --- trunk/lisp/url/url-http.el 2008-08-13 18:30:55.000000000 -0400 *************** *** 503,518 **** ;; automatically redirect the request unless it can be ;; confirmed by the user, since this might change the ;; conditions under which the request was issued. ! (if (member url-http-method '("HEAD" "GET")) ! ;; Automatic redirection is ok ! nil ! ;; It is just too big of a pain in the ass to get this ! ;; prompt all the time. We will just silently lose our ! ;; data and convert to a GET method. ! (url-http-debug "Converting `%s' request to `GET' because of REDIRECT(%d)" ! url-http-method url-http-response-status) ! (setq url-http-method "GET" ! url-http-data nil))) (303 ;; The response to the request can be found under a different ;; URI and SHOULD be retrieved using a GET method on that --- 503,511 ---- ;; automatically redirect the request unless it can be ;; confirmed by the user, since this might change the ;; conditions under which the request was issued. ! (unless (member url-http-method '("HEAD" "GET")) ! (setq redirect-uri nil)) ! nil) (303 ;; The response to the request can be found under a different ;; URI and SHOULD be retrieved using a GET method on that