1 import { jQuery } from "../core.js";
5 jQuery.ajaxPrefilter( function( s, origOptions ) {
7 // Binary data needs to be passed to XHR as-is without stringification.
8 if ( typeof s.data !== "string" && !jQuery.isPlainObject( s.data ) &&
9 !Array.isArray( s.data ) &&
11 // Don't disable data processing if explicitly set by the user.
12 !( "processData" in origOptions ) ) {
13 s.processData = false;
16 // `Content-Type` for requests with `FormData` bodies needs to be set
17 // by the browser as it needs to append the `boundary` it generated.
18 if ( s.data instanceof window.FormData ) {
19 s.contentType = false;