Skip to content

Commit

Permalink
Change reason-phrase to be optional but non-empty (instead of requrin…
Browse files Browse the repository at this point in the history
…g it and allowing it to be empty). Also add a note about what the absence of reason-phrase means in practice (#197)
  • Loading branch information
reschke committed Mar 26, 2019
1 parent 0ab3bfb commit 71b48cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
28 changes: 17 additions & 11 deletions draft-ietf-httpbis-messaging-latest.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions draft-ietf-httpbis-messaging-latest.xml
Expand Up @@ -717,11 +717,11 @@ https://www.example.org
<t>
The first line of a response message is the status-line, consisting
of the protocol version, a space (SP), the status code, another space,
a possibly empty textual phrase describing the status code, and
an &OPTIONAL; textual phrase describing the status code, and
ending with CRLF.
</t>
<sourcecode type="abnf7230"><iref primary="true" item="Grammar" subitem="status-line"/>
<x:ref>status-line</x:ref> = <x:ref>HTTP-version</x:ref> <x:ref>SP</x:ref> <x:ref>status-code</x:ref> <x:ref>SP</x:ref> <x:ref>reason-phrase</x:ref> <x:ref>CRLF</x:ref>
<x:ref>status-line</x:ref> = <x:ref>HTTP-version</x:ref> <x:ref>SP</x:ref> <x:ref>status-code</x:ref> <x:ref>SP</x:ref> [<x:ref>reason-phrase</x:ref>] <x:ref>CRLF</x:ref>
</sourcecode>
<t>
Although the status-line grammar rule requires that each of the component
Expand Down Expand Up @@ -759,8 +759,13 @@ https://www.example.org
reliable channel for information (it might be discarded or overwritten by
intermediaries, and it is not transmitted in other versions of HTTP).
</t>
<t>
Note that while the reason-phrase is optional, the preceding SP character
is not. In other words, absent a reason-phrase the status-line ends
with a trailing SP, followed by CRLF.
</t>
<sourcecode type="abnf7230"><iref primary="true" item="Grammar" subitem="reason-phrase"/>
<x:ref>reason-phrase</x:ref> = *( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
<x:ref>reason-phrase</x:ref> = 1*( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
</sourcecode>
</section>

Expand Down Expand Up @@ -3030,14 +3035,14 @@ Upgrade: HTTP/2.0
<x:ref>quoted-string</x:ref> = &lt;quoted-string, see <xref target="Semantics" x:fmt="," x:sec="4.2.3"/>&gt;

<x:ref>rank</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
<x:ref>reason-phrase</x:ref> = *( HTAB / SP / VCHAR / obs-text )
<x:ref>reason-phrase</x:ref> = 1*( HTAB / SP / VCHAR / obs-text )
<x:ref>request-line</x:ref> = method SP request-target SP HTTP-version CRLF
<x:ref>request-target</x:ref> = origin-form / absolute-form / authority-form /
asterisk-form

<x:ref>start-line</x:ref> = request-line / status-line
<x:ref>status-code</x:ref> = 3DIGIT
<x:ref>status-line</x:ref> = HTTP-version SP status-code SP reason-phrase CRLF
<x:ref>status-line</x:ref> = HTTP-version SP status-code SP [ reason-phrase ] CRLF

<x:ref>t-codings</x:ref> = "trailers" / ( transfer-coding [ t-ranking ] )
<x:ref>t-ranking</x:ref> = OWS ";" OWS "q=" rank
Expand Down Expand Up @@ -3379,6 +3384,7 @@ Upgrade: HTTP/2.0
<section title="Since draft-ietf-httpbis-messaging-04" anchor="changes.since.04">
<ul>
<li>In <xref target="header.upgrade"/>, clarify that protocol-name is to be matched case-insensitively (<eref target="https://github.com/httpwg/http-core/issues/8"/>)</li>
<li>In <xref target="status.line"/>, add clarifications about empty reason phrases (<eref target="https://github.com/httpwg/http-core/issues/197"/>)</li>
</ul>
</section>

Expand Down
4 changes: 2 additions & 2 deletions httpbis.abnf
Expand Up @@ -187,7 +187,7 @@ quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
qvalue = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
range-unit = bytes-unit / other-range-unit
rank = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
reason-phrase = *( HTAB / SP / VCHAR / obs-text )
reason-phrase = 1*( HTAB / SP / VCHAR / obs-text )
received-by = ( uri-host [ ":" port ] ) / pseudonym
received-protocol = [ protocol-name "/" ] protocol-version
relative-part = <relative-part, see [RFC3986], Section 4.2>
Expand All @@ -198,7 +198,7 @@ second = 2DIGIT
segment = <segment, see [RFC3986], Section 3.3>
start-line = request-line / status-line
status-code = 3DIGIT
status-line = HTTP-version SP status-code SP reason-phrase CRLF
status-line = HTTP-version SP status-code SP [ reason-phrase ] CRLF
subtype = token
suffix-byte-range-spec = "-" suffix-length
suffix-length = 1*DIGIT
Expand Down

0 comments on commit 71b48cb

Please sign in to comment.