Skip to content

Commit 1a617fd

Browse files
authored
Require 4xx and 5xx results to be http.error (#79)
This ensures that they are covered by a NEL policy's failure sampling rate, instead of its successful sampling rate.
1 parent 16c54c9 commit 1a617fd

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

index.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ <h2>Dependencies</h2>
172172
<p>The following terms are defined in the HTTP specification: [[!RFC7230]], [[!RFC7231]], [[!RFC7234]]</p>
173173
<ul>
174174
<li><dfn data-cite="!RFC7231#section-6.3.1" data-lt="200 response">200 status code</dfn></li>
175-
<li><dfn data-cite="!RFC7231#section-6.6">5xx status code</dfn></li>
175+
<li><dfn data-cite="!RFC7231#section-6.5" data-lt="4xx">4xx status code</dfn></li>
176+
<li><dfn data-cite="!RFC7231#section-6.6" data-lt="5xx">5xx status code</dfn></li>
176177
<li><dfn data-cite="!RFC7234">local cache</dfn></li>
177178
<li><dfn data-cite="!RFC7230#section-6.3">persistent connections</dfn></li>
178179
<li><dfn data-cite="!RFC7230#section-2.1" data-lt="requests">request</dfn></li>
@@ -330,12 +331,20 @@ <h2>Network requests</h2>
330331
<p>
331332
A <a>network request</a> is <dfn
332333
data-lt="succeed|succeeded">successful</dfn> if the user agent is able
333-
to receive a valid HTTP response from the server.
334+
to receive a valid HTTP response from the server, and that response does
335+
not have a <a>4xx</a> or <a>5xx</a> status code.
334336
</p>
335337

336338
<p>
337-
A <a>network request</a> is <dfn data-lt="fail">failed</dfn> if it is not
338-
<a>successful</a>.
339+
A <a>network request</a> is <dfn data-lt="fail|failures">failed</dfn> if
340+
it is not <a>successful</a>.
341+
</p>
342+
343+
<p class="note">
344+
Note that HTTP error responses (i.e., those with a <a>4xx</a> or
345+
<a>5xx</a> status code) are considered <a>failures</a>, so that they are
346+
subject to a <a>NEL policy</a>'s <a>failure sampling rate</a> instead of
347+
its <a>successful sampling rate</a>.
339348
</p>
340349
</section>
341350

@@ -1125,6 +1134,12 @@ <h2>Transmission of request and response errors</h2>
11251134
</p>
11261135

11271136
<dl>
1137+
<dt><code>http.error</code></dt>
1138+
<dd>
1139+
The user agent successfully received a response, but it had a <a>4xx</a>
1140+
or <a>5xx</a> status code
1141+
</dd>
1142+
11281143
<dt><code>http.protocol.error</code></dt>
11291144
<dd>The connection was aborted due to an HTTP protocol error</dd>
11301145

0 commit comments

Comments
 (0)