Skip to content

Commit cf436af

Browse files
Add validtion for headers and method in network.continueRequest
1 parent 34104f2 commit cf436af

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

index.bs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ spec: CORE-AAM; urlPrefix:https://www.w3.org/TR/core-aam-1.2
282282
spec: MEDIAQUERIES4; urlPrefix: https://drafts.csswg.org/mediaqueries-4/
283283
type: dfn
284284
text: resolution media feature; url: #resolution
285+
spec: RFC9110; urlPrefix: https://httpwg.org/specs/rfc9110.html
286+
type: dfn
287+
text: field-name token; url: #fields.names
288+
text: method token; url: #method.overview
285289
</pre>
286290

287291
<pre class="biblio">
@@ -6109,16 +6113,30 @@ The [=remote end steps=] given |session| and |command parameters| are:
61096113

61106114
1. If |command parameters| [=map/contains=] "<code>method</code>":
61116115

6112-
1. Let |request|'s [=request/method=] be |command
6113-
parameters|["<code>method</code>"].
6116+
1. Let |method| be |command parameters|["<code>method</code>"].
6117+
6118+
1. If |method| does not match the [=method token=] production, return [=error=]
6119+
with [=error code=] "<code>invalid argument</code>".
6120+
6121+
1. Let |request|'s [=request/method=] be |method|.
61146122

61156123
1. If |command parameters| [=map/contains=] "<code>headers</code>":
61166124

61176125
1. Let |headers| be an empty [=/header list=].
61186126

61196127
1. For |header| in |command parameters|["<code>headers</code>"]:
61206128

6121-
1. Append [=deserialize header=] with |header| to |headers|.
6129+
1. Let |deserialized header| be [=deserialize header=] with |header|.
6130+
6131+
1. If |deserialized header|'s name does not match the [=field-name token=]
6132+
production, return [=error=] with [=error code=]
6133+
"<code>invalid argument</code>".
6134+
6135+
1. If |deserialized header|'s value does not match the [=header value=]
6136+
production, return [=error=] with [=error code=]
6137+
"<code>invalid argument</code>".
6138+
6139+
1. Append |deserialized header| to |headers|.
61226140

61236141
1. Set |request|'s [=request/headers list=] to |headers|.
61246142

0 commit comments

Comments
 (0)