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 = {
245245 // To directly upload a File, we use a REST-style AJAX request
246246 var headers = {
247247 '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 )
249250 } ;
250251 var url = CoreManager . get ( 'SERVER_URL' ) ;
251252 if ( url [ url . length - 1 ] !== '/' ) {
Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ const RESTController = {
125125 } ;
126126
127127 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+ }
129131 if ( CoreManager . get ( 'IS_NODE' ) ) {
130132 headers [ 'User-Agent' ] = 'Parse/' + CoreManager . get ( 'VERSION' ) +
131133 ' (NodeJS ' + process . versions . node + ')' ;
You can’t perform that action at this time.
0 commit comments