Skip to content
Permalink
Browse files

Use the API URL character encoding for XMLHttpRequest

Unfortunately forcing UTF-8 is not web compatible.

This also cleans up some other steps in the open() method in the process.

Tests: https://hg.mozilla.org/releases/mozilla-beta/rev/fd6134823ff9.

Fixes #159.
  • Loading branch information...
annevk committed Dec 4, 2017
1 parent daa0bae commit 6f14c60f5ae81381c12ff50f5f6898a1583b570d
Showing with 22 additions and 31 deletions.
  1. +22 −31 xhr.bs
53 xhr.bs
@@ -446,33 +446,25 @@ and
methods, when invoked, must run these steps:

<ol>
<li><p>If <a>context object</a>'s
<a>relevant settings object</a> has a
<a>responsible document</a> and it is <em>not</em>
<a>fully active</a>,
<a>throw</a> an <code>InvalidStateError</code> exception.

<li><p>If <var>method</var> is not a
<a for=/>method</a>,
<a>throw</a> a
<code>SyntaxError</code> exception.

<li><p>If <var>method</var> is a <a>forbidden method</a>,
<a>throw</a> a
<code>SecurityError</code> exception.

<li><p><a for=method>Normalize</a>
<var>method</var>.

<li><p>Let <var>parsedURL</var> be the result of
<a lt="URL parser">parsing</a> <var>url</var> with
<a>context object</a>'s
<a>relevant settings object</a>'s
<a>API base URL</a>.
<li><p>Let <var>settingsObject</var> be <a>context object</a>'s <a>relevant settings object</a>.

<li><p>If <var>settingsObject</var> has a <a>responsible document</a> and it is <em>not</em>
<a>fully active</a>, then <a>throw</a> an "{{InvalidStateError!!exception}}" {{DOMException}}.

<li><p>If <var>method</var> is not a <a for=/>method</a>, then <a>throw</a> a
"{{SyntaxError!!exception}}" {{DOMException}}.

<li><p>If <var>parsedURL</var> is failure,
<a>throw</a> a
<code>SyntaxError</code> exception.
<li><p>If <var>method</var> is a <a>forbidden method</a>, then <a>throw</a> a
"{{SecurityError!!exception}}" {{DOMException}}.

<li><p><a for=method>Normalize</a> <var>method</var>.

<li><p>Let <var>parsedURL</var> be the result of <a lt="URL parser">parsing</a> <var>url</var> with
<var>settingsObject</var>'s <a for="environment settings object">API base URL</a> and
<var>settingsObject</var>'s <a for="environment settings object">API URL character encoding</a>.

<li><p>If <var>parsedURL</var> is failure, then <a>throw</a> a "{{SyntaxError!!exception}}"
{{DOMException}}.

<li>
<p>If the <var>async</var> argument is omitted, set <var>async</var> to true, and set
@@ -495,11 +487,10 @@ methods, when invoked, must run these steps:
<var>password</var>.
</ol>

<li><p>If <var>async</var> is false, <a>current global object</a> is a {{Window}}
object, and the {{XMLHttpRequest/timeout!!attribute}} attribute value is not zero
or the {{XMLHttpRequest/responseType}} attribute value is not the
empty string, then <a>throw</a> an
<code>InvalidAccessError</code> exception.
<li><p>If <var>async</var> is false, <a>current global object</a> is a {{Window}} object, and the
{{XMLHttpRequest/timeout!!attribute}} attribute value is not zero or the
{{XMLHttpRequest/responseType}} attribute value is not the empty string, then <a>throw</a> an
"{{InvalidAccessError!!exception}}" {{DOMException}}.

<li>
<p><a for=fetch lt=terminated>Terminate</a> the ongoing fetch operated by the

0 comments on commit 6f14c60

Please sign in to comment.
You can’t perform that action at this time.