Ajax: Support binary data (including FormData)
commita7ed9a7b6364273b1b964fd2cf9691dec2cbec6b
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 1 Feb 2023 12:48:35 +0000 (1 13:48 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 12:48:35 +0000 (1 13:48 +0100)
tree7503c5b33e00f93084d03617998f44149de35229
parent0b9c5037f707a0b8e0dbb11776b690ae7dde7123
Ajax: Support binary data (including FormData)

Two changes have been applied:
* prefilters are now applied before data is converted to a string;
  this allows prefilters to disable such a conversion
* a prefilter for binary data is added; it disables data conversion
  for non-string non-plain-object `data`; for `FormData` bodies, it
  removes manually-set `Content-Type` header - this is required
  as browsers need to append their own boundary to the header

Ref gh-4150
Closes gh-5197
package.json
src/ajax.js
src/ajax/binary.js [new file with mode: 0644]
src/jquery.js
test/data/mock.php
test/data/testinit.js
test/middleware-mockserver.js
test/unit/ajax.js