Permalink
Browse files

minor fix

  • Loading branch information...
1 parent 5bbeb39 commit b970be6ca9497f76365be58b17f22d52e888f96f jkf committed Mar 12, 2005
Showing with 15 additions and 2 deletions.
  1. +6 −0 webactions/ChangeLog
  2. +9 −2 webactions/webact.cl
@@ -1,3 +1,9 @@
+2005-03-11 John Foderaro <jkf@tiger.franz.com>
+
+ * webact.cl - back to using a 301 redirect if the request-method
+ is a post since modern browsers will complain about a 307
+ redirect in this case.
+
2005-02-10 John Foderaro <jkf@tiger.franz.com>
1.12
* clpage.cl - fix parsing of nested elements where the outer
View
@@ -24,7 +24,7 @@
;; Suite 330, Boston, MA 02111-1307 USA
;;
-;; $Id: webact.cl,v 1.13 2005/02/11 00:46:10 jkf Exp $
+;; $Id: webact.cl,v 1.14 2005/03/12 03:39:02 jkf Exp $
@@ -237,8 +237,15 @@
(find-locator :exact server)))
(defun redirect-to (req ent dest)
+ ;; the http v1.1 spec says that 307 (temporary redirects) should only be done
+ ;; silently for get's and head's. For all else (e.g. post)
+ ;; the browser should ask if the user wants to do the redirect.
+ ;; Thus we use the permantent redirect in that case
(with-http-response (req ent
- :response *response-temporary-redirect*)
+ :response
+ (if* (member (request-method req) '(:get :head))
+ then *response-temporary-redirect*
+ else *response-moved-permanently*))
(setf (reply-header-slot-value req :location) dest)
(with-http-body (req ent))))

0 comments on commit b970be6

Please sign in to comment.