codeguy/Slim — pull request #384 by fgalassi (2012-08-25 10:04:19+00:00)
Title: Fix redirect to set Location header only and leave body untouched.

Slim::redirect right now is kind of weird by returning the url in the body. That is like saying "i don't care of what is in the body, so let's put the url instead of nothing". But actually the Location header can be used in responses that need to have a body, especially when designing API.

e.g.
303 See others with representation of the resource in the body and Location pointing to other resources or
201 Created, with representation of the resource in the body and Location pointing to the canonical URL.

I changed it to leave the body alone. This may break compatibility but on a feature i don't think anyone is relying on. Maybe just in tests, but then again they should be checking the Location header directly, not the body.