Sending redirect require a body #48
Comments
This is how 'redirect' is defined def redirect(location: String, message: String = "moved") = {
render.plain(message).status(301).header("Location", location)
} You explicitly want to send a blank message? For now you can do: render.plain("").status(302).header("Location", redirectUrl) |
Just a heads up. According to the RFC unless the http method is |
+1, added a ticket to track here #49 Also, we should add an optional argument to redirect for |
Alright, so this is "as designed" then I guess. I only found this while Response response = Response.apply(HttpVersion.HTTP_1_1, but I guess that's not according to the RFC then. /Reik On Wed, Jun 19, 2013 at 7:57 PM, Julio Capote notifications@github.comwrote:
|
You can now send permanent redirects (34dd510), however this will add a message for you. If you wish to permanent redirect without a message, the workaround posted above should still work. Let me know if this satisfies your use case. Thanks! |
Thank you, sounds great. I'am fine with the message. On Thu, Jun 20, 2013 at 6:44 PM, Julio Capote notifications@github.comwrote:
|
Doing this:
render.status(HttpResponseStatus.MOVED_PERMANENTLY.getCode).header("Location", redirectUrl).toFuture
does not work because of the missing body. Responds with a 500 instead.
The text was updated successfully, but these errors were encountered: