diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-03-20 17:08:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 17:08:51 +0100 |
commit | ce264e0789116e37fe371503537a217c038dfae8 (patch) | |
tree | a674fe89ba02bbaf63723d07a4976ee87fe5dcc3 /src | |
parent | cff2899885c314d32eea42e9eef6ead6e5da5c2f (diff) | |
download | jquery-ce264e0789116e37fe371503537a217c038dfae8.tar.gz jquery-ce264e0789116e37fe371503537a217c038dfae8.zip |
Ajax: Allow `processData: true` even for binary data
The way gh-5197 implemented binary data handling, `processData`
was being explicitly set to `false`. This is expected but it made
it impossible to override it to `true`. The new logic will only
set `processData` to `false` if it wasn't explicitly passed
in original options.
Closes gh-5205
Ref gh-5197
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax/binary.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ajax/binary.js b/src/ajax/binary.js index e96661da7..16f06d7e9 100644 --- a/src/ajax/binary.js +++ b/src/ajax/binary.js @@ -2,10 +2,13 @@ import jQuery from "../core.js"; import "../ajax.js"; -jQuery.ajaxPrefilter( function( s ) { +jQuery.ajaxPrefilter( function( s, origOptions ) { // Binary data needs to be passed to XHR as-is without stringification. - if ( typeof s.data !== "string" && !jQuery.isPlainObject( s.data ) ) { + if ( typeof s.data !== "string" && !jQuery.isPlainObject( s.data ) && + + // Don't disable data processing if explicitly set by the user. + !( "processData" in origOptions ) ) { s.processData = false; } |