#64 ✓resolved

CreatedResponse doesn't redirect

Reported by adnan. | February 7th, 2009 @ 08:35 PM | in 0.11.1

The "Location:" header requires that the http response code be 3xx, and HTTP_CREATED is 201. Therefore the redirect doesn't work.

I changed it to HTTP_FOUND for now.


Comments and changes to this ticket

  • Kris Jordan

    Kris Jordan February 16th, 2009 @ 02:28 PM

    • Milestone set to 0.11.1
    • Tag set to headers, http, rest
    • State changed from “new” to “resolved”


    Thank-you for the bug report. This behavior is expected with the CreatedResponse. In a controller the shortcut method for created takes two parameters: $this->created($resourceUri, $contentUri = '')

    The $resourceUri is what is placed in the Location header. This is how we say "The resource you created can be addressed at this location." The second parameter, $contentUri, is the Uri in which we will return back as the body of the response. If left blank this will be the same as the Uri.

    You are right that this does not redirect and in order to redirect you must return a $this->redirect($redirectUri).

    Thank you for the bug submission!

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Recess PHP Framework is an open source, full stack, RESTful PHP framework.


People watching this ticket