Skip to content

Conversation

@MorrisJobke
Copy link
Member

Backport of #9627

When using fake servers with Sinon.JS, the JavaScript test framework,
the XHR objects are also fake. In Sinon 5.0.8 the "setRequestHeader" of
XMLHttpRequest was modified to normalize the header values (as requested
by the spec), but since then only string values are accepted; null or
integer values can no longer be passed to "setRequestHeader", as it
expects the "replace" function to be available in the object. However,
in the tests null and integer values are passed to "setRequestHeader",
which causes them to fail.

Both Firefox and Chromium accept passing non-string values to their
"setRequestHeader" implementation, and it is done, for example, in
davclient.js; it is not clear yet whether Sinon got too restrictive or
the code calling "setRequestHeader" was too loose. Given that
davclient.js is an external dependency, as a temporary measure Sinon
version is forced to be 5.0.7 at most until either Sinon or davclient.js
are updated.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@MorrisJobke MorrisJobke added the 3. to review Waiting for reviews label May 28, 2018
@MorrisJobke MorrisJobke added this to the Nextcloud 12.0.8 milestone May 28, 2018
@MorrisJobke
Copy link
Member Author

👍 from my side as well

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 28, 2018
@rullzer rullzer merged commit 46a6945 into stable12 May 28, 2018
@rullzer rullzer deleted the backport/9627/stable12 branch May 28, 2018 11:28
@MorrisJobke MorrisJobke mentioned this pull request May 31, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants