The Reason Phrase on a response is optional.

The standard has it as *<TEXT, exlcuding CR, LF>
and a response with no reason phrase was found in
the wild.
version0.2
Jeremy Hinegardner 16 years ago committed by Ryan
parent 36e74bea33
commit 4ac5581cc6

@ -378,8 +378,8 @@ do { \
Request_Line = ( Method " " Request_URI ("#" Fragment)? " " HTTP_Version CRLF ) ;
StatusCode = (digit digit digit) $status_code;
ReasonPhrase = ascii+ -- ("\r" | "\n");
StatusLine = HTTP_Version " " StatusCode " " ReasonPhrase CRLF;
ReasonPhrase = ascii* -- ("\r" | "\n");
StatusLine = HTTP_Version " " StatusCode (" " ReasonPhrase)? CRLF;
# chunked message
trailing_headers = header*;

@ -354,6 +354,16 @@ const struct message responses[] =
,.body= ""
}
, {.name= "301 no response phrase"
,.type= HTTP_RESPONSE
,.raw= "HTTP/1.1 301\r\n\r\n"
,.should_keep_alive = TRUE
,.status_code= 301
,.num_headers= 0
,.headers= {}
,.body= ""
}
, {.name= NULL } /* sentinel */
};

Loading…
Cancel
Save