@@ -58,7 +58,10 @@ export class ITMSTransporterService implements IITMSTransporterService {
58
58
contentDeliveryResponse = await this . $httpClient . httpRequest ( {
59
59
url : "https://contentdelivery.itunes.apple.com/WebObjects/MZLabelService.woa/json/MZITunesProducerService" ,
60
60
method : "POST" ,
61
- body : requestBody
61
+ body : requestBody ,
62
+ headers : {
63
+ "Content-Length" : requestBody . length
64
+ }
62
65
} ) ,
63
66
contentDeliveryBody : IContentDeliveryBody = JSON . parse ( contentDeliveryResponse . body ) ;
64
67
@@ -170,12 +173,12 @@ export class ITMSTransporterService implements IITMSTransporterService {
170
173
return this . _itmsTransporterPath ;
171
174
}
172
175
173
- private getContentDeliveryRequestBody ( credentials : ICredentials ) : string {
176
+ private getContentDeliveryRequestBody ( credentials : ICredentials ) : Buffer {
174
177
// All of those values except credentials are hardcoded
175
178
// Apple's content delivery API is very picky with handling requests
176
179
// and if only one of these ends up missing the API returns
177
180
// a response with 200 status code and an error
178
- return JSON . stringify ( {
181
+ return Buffer . from ( JSON . stringify ( {
179
182
id : "1" , // magic number
180
183
jsonrpc : "2.0" ,
181
184
method : "lookupSoftwareApplications" ,
@@ -186,7 +189,7 @@ export class ITMSTransporterService implements IITMSTransporterService {
186
189
Application : "Application Loader" ,
187
190
OSIdentifier : "Mac OS X 10.8.5 (x86_64)"
188
191
}
189
- } ) ;
192
+ } ) , "utf8" ) ;
190
193
}
191
194
192
195
private getITMSMetadataXml ( appleId : string , ipaFileName : string , ipaFileHash : string , ipaFileSize : number ) : string {
0 commit comments