popcorn: redirect uses 303 by default
authorJean Privat <jean@pryen.org>
Fri, 19 Aug 2016 13:58:16 +0000 (09:58 -0400)
committerJean Privat <jean@pryen.org>
Fri, 19 Aug 2016 19:09:48 +0000 (15:09 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/popcorn/pop_handlers.nit

index 1a22db6..e4da4a5 100644 (file)
@@ -464,12 +464,15 @@ redef class HttpResponse
        end
 
        # Redirect response to `location`
+       #
+       # Use by default 303 See Other as it is the RFC
+       # way to redirect web applications to a new URI.
        fun redirect(location: String, status: nullable Int) do
                header["Location"] = location
                if status != null then
                        status_code = status
                else
-                       status_code = 302
+                       status_code = 303
                end
                check_sent
                sent = true