andreas | 3 Apr 13:22

r11773 - trunk/libraries/network/koala/sources/koala

Author: andreas
Date: Thu Apr  3 13:25:31 2008
New Revision: 11773

Modified:
   trunk/libraries/network/koala/sources/koala/errors.dylan
   trunk/libraries/network/koala/sources/koala/library-unix.dylan
   trunk/libraries/network/koala/sources/koala/urls.dylan
Log:
job: minor

Temporarily redirect.

Modified: trunk/libraries/network/koala/sources/koala/errors.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/errors.dylan	(original)
+++ trunk/libraries/network/koala/sources/koala/errors.dylan	Thu Apr  3 13:25:31 2008
@@ -136,6 +136,11 @@
     "The requested document has moved permanently to %s",
     location;

+define http-error moved-temporarily-redirect (<http-redirect-error>)
+    302
+    "The document has moved temporarily to %s",
+    loction;
+
 define http-error see-other-redirect (<http-redirect-error>)
     303 "See Other";

Modified: trunk/libraries/network/koala/sources/koala/library-unix.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/library-unix.dylan	(original)
+++ trunk/libraries/network/koala/sources/koala/library-unix.dylan	Thu Apr  3 13:25:31 2008
@@ -176,7 +176,8 @@
     count-query-values,
     application-error,
     current-url,
-    redirect-to;
+    redirect-to,
+    redirect-temporarily-to;

   // Virtual hosts
   create
@@ -260,6 +261,7 @@

   create
     moved-permanently-redirect,
+    moved-temporarily-redirect,
     see-other-redirect,
     unauthorized-error;

Modified: trunk/libraries/network/koala/sources/koala/urls.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/urls.dylan	(original)
+++ trunk/libraries/network/koala/sources/koala/urls.dylan	Thu Apr  3 13:25:31 2008
@@ -21,3 +21,15 @@
 define method redirect-to (url :: <url>)
   redirect-to(build-uri(url));
 end;
+
+define open generic redirect-temporarily-to (object :: <object>);
+
+define method redirect-temporarily-to (url :: <string>)
+  let headers = current-response().response-headers;
+  add-header(headers, "Location", url);
+  moved-temporarily-redirect(headers: headers);
+end method redirect-to;
+
+define method redirect-temporarily-to (url :: <url>)
+  redirect-to(build-uri(url));
+end;
--

-- 
Gd-chatter mailing list
Gd-chatter <at> gwydiondylan.org
https://www.opendylan.org/mailman/listinfo/gd-chatter


Gmane