Skip to content

Commit 2aee720

Browse files
authored
Remove unnecessary fields and URL parts (#164)
This removes from NEL reports the fields and portions of the URL which are not relevant to a given error, given the connection phase. Closes: #105
1 parent 855a35b commit 2aee720

File tree

1 file changed

+75
-31
lines changed

1 file changed

+75
-31
lines changed

index.html

+75-31
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ <h2>Dependencies</h2>
249249
<p>The following terms are defined in the URL specification: [[URL]]</p>
250250
<ul>
251251
<li><dfn data-cite="!URL#concept-url-fragment">fragment</dfn></li>
252-
<li><dfn data-cite="!URL#concept-host">host</dfn></li>
252+
<li><dfn data-cite="!URL#concept-url-path">path</dfn></li>
253+
<li><dfn data-cite="!URL#concept-url-query">query</dfn></li>
253254
<li><dfn data-cite="!URL#concept-url">URL</dfn></li>
255+
<li><dfn data-cite="!URL#concept-url-serializer">URL serializer</dfn></li>
254256
</ul>
255257
</dd>
256258
</dl>
@@ -1089,21 +1091,49 @@ <h2>Extract response headers</h2>
10891091
following properties: [[ECMA-262]]
10901092

10911093
<dl>
1092-
<dt><code>referrer</code></dt>
1094+
<dt><code>sampling_fraction</code></dt>
1095+
<dd><var>sampling rate</var></dd>
1096+
1097+
<dt><code>elapsed_time</code></dt>
10931098
<dd>
1094-
<var>request</var>'s referrer, as determined by the <a>referrer
1095-
policy</a> associated with its <a>client</a>.
1099+
The elapsed number of milliseconds between the start of the resource
1100+
fetch and when it was completed or aborted by the user agent.
10961101
</dd>
10971102

1098-
<dt><code>sampling_fraction</code></dt>
1099-
<dd><var>sampling rate</var></dd>
1103+
<dt><code>phase</code></dt>
1104+
<dd>
1105+
If <var>request</var> <a>failed</a>, the
1106+
<a data-lt="type-phase">phase</a> of its <a>network error</a>. If
1107+
<var>request</var> <a>succeeded</a>, <code>"application"</code>.
1108+
</dd>
11001109

1110+
<dt><code>type</code></dt>
1111+
<dd>
1112+
If <var>request</var> <a>failed</a>, the <a>type</a> of its
1113+
<a>network error</a>. If <var>request</var> <a>succeeded</a>,
1114+
<code>"ok"</code>.
1115+
</dd>
1116+
</dl>
1117+
</li>
1118+
1119+
<li>
1120+
If <var>report body</var>'s <code>phase</code> property is not
1121+
<code>dns</code>, append the following properties to <var>report
1122+
body</var>:
1123+
<dl>
11011124
<dt><code>server_ip</code></dt>
1102-
<dd>The IP address of the <a>server</a> to which the user agent sent the request, if available. Otherwise, an empty string.
1103-
<ul>
1104-
<li>A host identified by an IPv4 address is represented in dotted-decimal notation (a sequence of four decimal numbers in the range 0 to 255, separated by "."). [[RFC1123]]</li>
1105-
<li>A host identified by an IPv6 address is represented as an ordered list of eight 16-bit pieces (a sequence of `x:x:x:x:x:x:x:x`, where the 'x's are one to four hexadecimal digits of the eight 16-bit pieces of the address). [[RFC4291]] </li>
1106-
</ul>
1125+
<dd>The IP address of the <a>server</a> to which the user agent sent
1126+
the request, if available. Otherwise, an empty string.
1127+
<ul>
1128+
<li>A host identified by an IPv4 address is represented in
1129+
dotted-decimal notation (a sequence of four decimal numbers in
1130+
the range 0 to 255, separated by "."). [[RFC1123]]</li>
1131+
<li>A host identified by an IPv6 address is represented as an
1132+
ordered list of eight 16-bit pieces (a sequence of
1133+
`x:x:x:x:x:x:x:x`, where the 'x's are one to four hexadecimal
1134+
digits of the eight 16-bit pieces of the address). [[RFC4291]]
1135+
</li>
1136+
</ul>
11071137
</dd>
11081138

11091139
<dt><code>protocol</code></dt>
@@ -1112,6 +1142,19 @@ <h2>Extract response headers</h2>
11121142
identified by the ALPN Protocol ID, if available. Otherwise,
11131143
<code>""</code>.
11141144
</dd>
1145+
</dl>
1146+
</li>
1147+
1148+
<li>
1149+
If <var>report body</var>'s <code>phase</code> property is not
1150+
<code>dns</code> or <code>connection</code>, append the following
1151+
properties to <var>report body</var>:
1152+
<dl>
1153+
<dt><code>referrer</code></dt>
1154+
<dd>
1155+
<var>request</var>'s referrer, as determined by the <a>referrer
1156+
policy</a> associated with its <a>client</a>.
1157+
</dd>
11151158

11161159
<dt><code>method</code></dt>
11171160
<dd><var>request</var>'s <a>request method</a>.</dd>
@@ -1133,26 +1176,6 @@ <h2>Extract response headers</h2>
11331176
The <a>status code</a> of the HTTP response, if available.
11341177
Otherwise, <code>0</code>.
11351178
</dd>
1136-
1137-
<dt><code>elapsed_time</code></dt>
1138-
<dd>
1139-
The elapsed number of milliseconds between the start of the resource
1140-
fetch and when it was completed or aborted by the user agent.
1141-
</dd>
1142-
1143-
<dt><code>phase</code></dt>
1144-
<dd>
1145-
If <var>request</var> <a>failed</a>, the
1146-
<a data-lt="type-phase">phase</a> of its <a>network error</a>. If
1147-
<var>request</var> <a>succeeded</a>, <code>"application"</code>.
1148-
</dd>
1149-
1150-
<dt><code>type</code></dt>
1151-
<dd>
1152-
If <var>request</var> <a>failed</a>, the <a>type</a> of its
1153-
<a>network error</a>. If <var>request</var> <a>succeeded</a>,
1154-
<code>"ok"</code>.
1155-
</dd>
11561179
</dl>
11571180
</li>
11581181

@@ -1236,6 +1259,22 @@ <h2>Extract response headers</h2>
12361259
</p>
12371260

12381261
<ol class="algorithm">
1262+
<li>
1263+
<p>Let <var>url</var> be <var>request</var>'s URL.</p>
1264+
</li>
1265+
<li>
1266+
<p>Clear <var>url</var>'s <a>fragment</a>.</p>
1267+
</li>
1268+
<li>
1269+
<p>
1270+
If <var>report body</var>'s <code>phase</code> property is
1271+
<code>dns</code> or <code>connection</code>:</p>
1272+
<ol>
1273+
<li>
1274+
<p>Clear <var>url</var>'s <a>path</a> and <a>query</a>.</p>
1275+
</li>
1276+
</ol>
1277+
</li>
12391278
<li>
12401279
<p><a>Generate a network report</a> given these parameters:</p>
12411280

@@ -1246,8 +1285,13 @@ <h2>Extract response headers</h2>
12461285
<dd><var>report body</var></dd>
12471286
<dt>endpoint group</dt>
12481287
<dd><var>policy</var>'s <a>reporting group</a></dd>
1288+
<dt>url</dt>
1289+
<dd>The result of running the <a>URL serializer</a> on
1290+
<var>url</var>.
1291+
</dd>
12491292
</dl>
12501293
</li>
1294+
12511295
</ol>
12521296
</section>
12531297
</section>

0 commit comments

Comments
 (0)