File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ var DefaultController = {
245
245
// To directly upload a File, we use a REST-style AJAX request
246
246
var headers = {
247
247
'X-Parse-Application-ID' : CoreManager . get ( 'APPLICATION_ID' ) ,
248
- 'X-Parse-JavaScript-Key' : CoreManager . get ( 'JAVASCRIPT_KEY' )
248
+ 'X-Parse-JavaScript-Key' : CoreManager . get ( 'JAVASCRIPT_KEY' ) ,
249
+ 'Content-Type' : source . type || ( source . file ? source . file . type : null )
249
250
} ;
250
251
var url = CoreManager . get ( 'SERVER_URL' ) ;
251
252
if ( url [ url . length - 1 ] !== '/' ) {
Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ const RESTController = {
125
125
} ;
126
126
127
127
headers = headers || { } ;
128
- headers [ 'Content-Type' ] = 'text/plain' ; // Avoid pre-flight
128
+ if ( typeof ( headers [ 'Content-Type' ] ) !== 'string' ) {
129
+ headers [ 'Content-Type' ] = 'text/plain' ; // Avoid pre-flight
130
+ }
129
131
if ( CoreManager . get ( 'IS_NODE' ) ) {
130
132
headers [ 'User-Agent' ] = 'Parse/' + CoreManager . get ( 'VERSION' ) +
131
133
' (NodeJS ' + process . versions . node + ')' ;
You can’t perform that action at this time.
0 commit comments