From 27d33a302762b6a0315fee3c85a97f5174339cb8 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 20 Mar 2014 23:18:14 +0400 Subject: [PATCH] Improved ajax post --- app/js/lib/mtproto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js index f490c54c..4d007a71 100644 --- a/app/js/lib/mtproto.js +++ b/app/js/lib/mtproto.js @@ -1071,7 +1071,7 @@ factory('MtpAuthorizer', function (MtpDcConfigurator, MtpRsaKeysManager, MtpSecu delete $http.defaults.headers.post['Content-Type']; delete $http.defaults.headers.common['Accept']; - return $http.post('http://' + MtpDcConfigurator.chooseServer(dcID) + '/apiw1', resultArray, { + return $http.post('http://' + MtpDcConfigurator.chooseServer(dcID) + '/apiw1', resultArray.buffer, { responseType: 'arraybuffer', transformRequest: null, transformResponse: function (responseBuffer) { @@ -2028,7 +2028,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato delete $http.defaults.headers.post['Content-Type']; delete $http.defaults.headers.common['Accept']; - return $http.post('http://' + MtpDcConfigurator.chooseServer(self.dcID) + '/apiw1', request.getArray(), { + return $http.post('http://' + MtpDcConfigurator.chooseServer(self.dcID) + '/apiw1', request.getBuffer(), { responseType: 'arraybuffer', transformRequest: null });