all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: thomas weidner <thomas_weidner@gmx.de>
Cc: 701@emacsbugs.donarmstrong.com
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	[thread overview]
Message-ID: <87tzdoo88a.fsf@stupidchicken.com> (raw)

> 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






             reply	other threads:[~2008-08-13 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13 22:33 Chong Yidong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-08-12 12:59 bug#701: 23.0.60; url-http.el package should not rewrite POST to GET upon 301 reply thomas weidner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tzdoo88a.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=701@emacsbugs.donarmstrong.com \
    --cc=thomas_weidner@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.