Skip to content

Commit b765cb6

Browse files
committed
Allow method="POST"
Web Share Target can generate GET or POST requests.
1 parent 438a663 commit b765cb6

File tree

1 file changed

+60
-14
lines changed

1 file changed

+60
-14
lines changed

index.html

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ <h3>
247247
<code>undefined</code>.
248248
</li>
249249
<li>If <var>share target</var>["<a data-link-for=
250-
"ShareTarget">method</a>"] is not an <a data-cite=
250+
"ShareTarget">method</a>"] is neither an <a data-cite=
251251
"!INFRA#ascii-case-insensitive">ASCII case-insensitive</a> match for
252-
the string <code>"GET"</code>, <a data-cite=
253-
"!appmanifest#dfn-issue-a-developer-warning">issue a developer
254-
warning</a> that the method is not supported, and return
255-
<code>undefined</code>.
252+
the strings <code>"GET"</code> nor <code>"POST"</code>,
253+
<a data-cite="!appmanifest#dfn-issue-a-developer-warning">issue a
254+
developer warning</a> that the method is not supported, and return
255+
<code>undefined</code>.
256256
</li>
257257
<li>Let <var>action</var> be the result of <a data-cite=
258258
"!URL#concept-url-parser">parsing</a> the <a data-cite=
@@ -454,7 +454,7 @@ <h3>
454454
run the following steps:
455455
</p>
456456
<ol>
457-
<li>Let <var>action</var> be
457+
<li>Let <var>url</var> be a copy of
458458
<var>manifest</var>["<a>share_target</a>"]["<a data-link-for=
459459
"ShareTarget">action</a>"].
460460
</li>
@@ -483,16 +483,62 @@ <h3>
483483
</li>
484484
</ul>
485485
</li>
486-
<li>Let <var>query</var> be the result of running the <a data-cite=
487-
"!URL#concept-urlencoded-serializer"><code>application/x-www-form-urlencoded</code>
488-
serializer</a> with entry list and no encoding override.
486+
<li>Let <var>header list</var> be a new empty <a data-cite=
487+
"!FETCH/#concept-header-list">header list</a>.
488+
</li>
489+
<li>Let <var>method</var> be
490+
<var>manifest</var>["<a>share_target</a>"]["<a data-link-for=
491+
"ShareTarget">method</a>"].
492+
</li>
493+
<li>If <var>method</var> is <code>"GET"</code>:
494+
<ol>
495+
<li>Let <var>query</var> be the result of running the
496+
<a data-cite=
497+
"!URL#concept-urlencoded-serializer"><code>application/x-www-form-urlencoded</code>
498+
serializer</a> with <var>entry list</var> and no encoding
499+
override.
500+
</li>
501+
<li>Set <var>url</var>'s <a data-cite=
502+
"!URL#concept-url-query">query</a> component to <var>query</var>.
503+
</li>
504+
<li>Let <var>body</var> be null.
505+
</li>
506+
</ol>
507+
</li>
508+
<li>Otherwise, if <var>method</var> is <code>"POST"</code>:
509+
<ol>
510+
<li>Let <var>body</var> be the result of running the
511+
<a data-cite="!HTML#multipart/form-data-encoding-algorithm"><code>
512+
multipart/form-data</code> encoding algorithm</a> with
513+
<var>entry list</var> and <a data-cite="!UTF-8">UTF-8</a>
514+
encoding.
515+
</li>
516+
<li>Let <var>MIME type</var> be the concatenation of the string
517+
<code>"multipart/form-data;"</code>, a U+0020 SPACE character,
518+
the string <code>"boundary="</code>, and the <a data-cite=
519+
"!HTML#multipart/form-data-boundary-string"><code>multipart/form-data</code>
520+
boundary string</a> generated by the <a data-cite=
521+
"!HTML#multipart/form-data-encoding-algorithm"><code>multipart/form-data</code>
522+
encoding algorithm</a>.
523+
</li>
524+
<li>
525+
<a data-cite="!FETCH/#concept-header-list-append">Append</a>
526+
<code>Content-Type/</code><var>MIME type</var> to <var>header
527+
list</var>.
528+
</li>
529+
</ol>
489530
</li>
490-
<li>Set <var>action</var>'s <a data-cite=
491-
"!URL#concept-url-query">query</a> component to <var>query</var>.
531+
<li>Let <var>browsing context</var> be the result of creating a
532+
<a data-cite="!HTML#creating-a-new-browsing-context">new</a>
533+
<a data-cite="!HTML#top-level-browsing-context">top-level browsing
534+
context</a>.
492535
</li>
493-
<li>Run the <a data-cite="!HTML#window-open-steps">window open
494-
steps</a> on <var>action</var>, with empty <var>target</var> and
495-
empty <var>features</var>.
536+
<li>
537+
<a data-cite="!HTML#navigate">Navigate</a> <var>browsing
538+
context</var> to a new <a data-cite=
539+
"!FETCH/#concept-request">request</a> whose method is
540+
<var>method</var>, url is <var>url</var>, header list is
541+
<var>header list</var>, and body is <var>body</var>.
496542
</li>
497543
</ol>
498544
<p class="note">

0 commit comments

Comments
 (0)