all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#701: 23.0.60; url-http.el package should not rewrite POST to GET upon 301 reply
@ 2008-08-12 12:59 thomas weidner
  0 siblings, 0 replies; 2+ messages in thread
From: thomas weidner @ 2008-08-12 12:59 UTC (permalink / raw)
  To: emacs-pretest-bug


Hi,

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.






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#701: 23.0.60; url-http.el package should not rewrite POST to GET upon 301 reply
@ 2008-08-13 22:33 Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2008-08-13 22:33 UTC (permalink / raw)
  To: thomas weidner; +Cc: 701

> 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






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-13 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13 22:33 bug#701: 23.0.60; url-http.el package should not rewrite POST to GET upon 301 reply Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2008-08-12 12:59 thomas weidner

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.