Skip to content

Commit 7dc7aac

Browse files
committed
Add a Pass Through command for use by intermediary nodes
This is required to allow an intermediary node to send commands upstream.
1 parent 9f04177 commit 7dc7aac

File tree

1 file changed

+106
-1
lines changed

1 file changed

+106
-1
lines changed

webdriver-spec.html

+106-1
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ <h3>Processing Model</h3>
881881
the <a>session</a> with <a data-lt="session id">ID</a> <var>session id</var>.
882882
</ol>
883883

884-
<li><p>If <var>request</var>’s <a>method</a> is POST:
884+
<li><p>If <var>request</var>’s <a>method</a> is <code>POST</code>
885+
or <code>PUT</code>:
885886

886887
<ol>
887888
<li><p>Let <var>parse result</var> be the result of
@@ -1383,6 +1384,26 @@ <h3>List of Endpoints</h3>
13831384
<td><a>Take Element Screenshot</a></td>
13841385
</tr>
13851386
</table>
1387+
1388+
<p>The table of endpoint nodes for an <a>intermediary node</a> has the following
1389+
endpoints:
1390+
1391+
<table class=simple>
1392+
<tr>
1393+
<th>Method</th>
1394+
<th>URI Template</th>
1395+
<th>Command</th>
1396+
</tr>
1397+
1398+
<tr><td>POST</td><td>/session</td><td><a>New Session</a></td></tr>
1399+
<tr><td>DELETE</td><td>/session/{<var>session id</var>}</td><td><a>Delete Session</a></td></tr>
1400+
<tr><td>GET</td><td>/status</td><td><a>Status</a></td></tr>
1401+
<tr><td>DELETE</td><td>/session/{<var>session id</var>}/{/<var>paths*</var>}</td><td><a>Pass Through</a></td></tr>
1402+
<tr><td>GET</td><td>/session/{<var>session id</var>}/{/<var>paths*</var>}</td><td><a>Pass Through</a></td></tr>
1403+
<tr><td>POST</td><td>/session/{<var>session id</var>}/{/<var>paths*</var>}</td><td><a>Pass Through</a></td></tr>
1404+
<tr><td>PUT</td><td>/session/{<var>session id</var>}/{/<var>paths*</var>}</td><td><a>Pass Through</a></td></tr>
1405+
</table>
1406+
13861407
</section> <!-- /List of Endpoints -->
13871408

13881409
<section>
@@ -8751,6 +8772,90 @@ <h3>Take Element Screenshot</h3>
87518772
</section> <!-- /Take Element Screenshot -->
87528773
</section> <!-- /Screen Capture -->
87538774

8775+
<section>
8776+
<h2>Intermediary Node Commands</h2>
8777+
8778+
<p>In most cases, an intermediary node simply needs to accept incoming
8779+
commands from <a>downstream</a>, identify the correct <a>associated
8780+
session</a> and forward the command <a>upstream</a>, awaiting the
8781+
response and sending it back <a>downstream</a>. However, there are some
8782+
commands that behave differently in an intermediary node, and some that
8783+
are specific to <a>intermediary nodes</a>.
8784+
8785+
<section>
8786+
<h3>Pass Through</h3>
8787+
8788+
<table class="simple jsoncommand">
8789+
<tr>
8790+
<th>HTTP Method</th>
8791+
<th>Path Template</th>
8792+
</tr>
8793+
<tr>
8794+
<td>DELETE</td>
8795+
<td>/session/{<var>session id</var>}{/<var>paths</var>*}</td>
8796+
</tr>
8797+
<tr>
8798+
<td>GET</td>
8799+
<td>/session/{<var>session id</var>}{/<var>paths</var>*}</td>
8800+
</tr>
8801+
<tr>
8802+
<td>POST</td>
8803+
<td>/session/{<var>session id</var>}{/<var>paths</var>*}</td>
8804+
</tr>
8805+
<tr>
8806+
<td>PUT</td>
8807+
<td>/session/{<var>session id</var>}{/<var>paths</var>*}</td>
8808+
</tr>
8809+
</table>
8810+
8811+
<p>The <dfn>Pass Through</dfn> <a>command</a> forwards a command from
8812+
a <a>downstream</a> neighbor <a>upstream</a> to an <a>associated
8813+
session</a>, and the returns the response back to
8814+
the <a>downstream</a> neighbor.
8815+
8816+
<p>The <a>remote end steps</a> are:
8817+
<ol>
8818+
<li><p>If there is no <a>associated session</a> for the
8819+
reference <var>session</var> return an <a>error</a> with
8820+
<a>error code</a> <a>invalid session id</a>.
8821+
8822+
<li><p>Let <var>upstream url</var> be a <a>URL</a> created by
8823+
concatenating the <a>associated session</a>'s <a>URL</a>, <a>URL
8824+
prefix</a>, "<code>/session/</code>", the reference to
8825+
<var>session id</var>, and the referenced <var>paths</var>.
8826+
8827+
<li><p>Let <var>connection</var> be the result of creating a new HTTP
8828+
connection to <var>upstream url</var> with the same <a>method</a> as
8829+
this command was called with. How this is done is outside the scope
8830+
of this specification.
8831+
8832+
<p class=issue>Set the headers of the HTTP request.
8833+
8834+
<li><p>If <a>method</a> is <code>POST</code> or <code>PUT</code>:
8835+
<ol>
8836+
<li><p>Let <var>data</var> be the result of <a data-lt="json
8837+
serialization">serializing as JSON</a> <var>parameters</var>.
8838+
8839+
<p class=note>This must create a JSON <a>Object</a> that is
8840+
isomorphic to the original JSON <a>Object</a> parsed in step 6 of
8841+
the <a href="#processing model">processing model</a>.
8842+
8843+
<li><p>Transmit <var>data</var> to the <a>upstream</a> node
8844+
using <var>connection</var>.
8845+
</ol>
8846+
8847+
<li><p>Await the <var>response</var> from the <a>upstream</a>
8848+
node. Let <var>status code</var> be the <a>HTTP status</a> sent from
8849+
the <a>upstream</a> node.
8850+
8851+
<li><p><a>Send a response</a> with arguments <var>status code</var>
8852+
and <var>response</var>.
8853+
</ol>
8854+
8855+
</section> <!-- /Pass Through -->
8856+
8857+
</section> <!-- /Intermediary Node Commands -->
8858+
87548859
<section class=appendix>
87558860
<h2>Privacy Considerations</h2>
87568861

0 commit comments

Comments
 (0)