File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,6 @@ var SpotifyWebApi = (function () {
98
98
if ( _accessToken ) {
99
99
req . setRequestHeader ( 'Authorization' , 'Bearer ' + _accessToken ) ;
100
100
}
101
- if ( requestData . contentType ) {
102
- req . setRequestHeader ( 'Content-Type' , requestData . contentType ) ;
103
- }
104
101
105
102
req . onreadystatechange = function ( ) {
106
103
if ( req . readyState === 4 ) {
@@ -124,10 +121,13 @@ var SpotifyWebApi = (function () {
124
121
} else {
125
122
var postData = null ;
126
123
if ( requestData . postData ) {
127
- postData =
128
- requestData . contentType === 'image/jpeg'
129
- ? requestData . postData
130
- : JSON . stringify ( requestData . postData ) ;
124
+ if ( requestData . contentType === 'image/jpeg' ) {
125
+ postData = requestData . postData ;
126
+ req . setRequestHeader ( 'Content-Type' , requestData . contentType ) ;
127
+ } else {
128
+ postData = JSON . stringify ( requestData . postData ) ;
129
+ req . setRequestHeader ( 'Content-Type' , 'application/json' ) ;
130
+ }
131
131
}
132
132
req . send ( postData ) ;
133
133
}
You can’t perform that action at this time.
0 commit comments