Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CreatedResponse doesn't redirect

#64

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.

http://github.com/adnanali/reces...

Reported by adnan. · February 7th, 2009 @ 08:35 PM

State: resolved
Milestone: 0.11.1
Assigned to: Kris Jordan Kris Jordan

Activity

  1. Kris Jordan
    Kris Jordan
    • Milestone set to 0.11.1
    • Tag set to headers, http, rest
    • State changed from new to resolved

    Adnan,

    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!

    February 16th, 2009 @ 02:28 PM

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.