Hi Michael,

On 07/06/10 15:41, Michael Rehse wrote:
> Using Restlet 1.1.10 and the Jetty connector (com.noelios.restlet.ext.jetty
> 1.1.10) deployed as a standalone application, if I set the status to "200
> Foo" the response comes back as "200 OK".
>
> This is not the expected behavior - is it?
>
> I have found the location of the problem - in the
> com.noelios.restlet.ext.jetty.JettyCall class, sendResponse method, the else
> reads:
>
> getConnection().getResponse().setStatus(getStatusCode());
>
> It should read:
>
> getConnection().getResponse().setStatus(getStatusCode(), getReasonPhrase());
>
> Should I open an issue for this?

Maybe going off-topic a bit (I don't really know whether there's a bug 
or not).

I'm just wondering why changing the reason phrase matters in your 
application.

The HTTP spec says:
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1>

- "The Status-Code is intended for use by automata and the Reason-Phrase 
is intended for the human user. The client is not required to examine or 
display the Reason- Phrase."

- "The reason phrases listed here are only recommendations -- they MAY 
be replaced by local equivalents without affecting the protocol."


Essentially, if a client really relies on the reason phrase, that 
implies it expects a different behaviour from the protocol according to 
that reason phrase. As such, it wouldn't be compliant with HTTP and, 
although it's of course not a crime, there would certainly be negative 
side-effects that you'd have to accept unfortunately.

I think reason-phrases ought to be treated hint data targeted for people 
who read and debug HTTP content on the wire, nothing more. Maybe that's 
your use case, with a custom status code, perhaps.


Best wishes,

Bruno.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2618832

Reply via email to