diff --git a/src/qupload.js b/src/qupload.js index 51277ed..988191e 100644 --- a/src/qupload.js +++ b/src/qupload.js @@ -72,6 +72,11 @@ var uploadEndPoint = 'http://up.qiniu.com'; + // if page loaded over HTTPS, then uploadEndPoint should be "https://up.qbox.me", see https://github.com/qiniu/js-sdk/blob/master/README.md#%E8%AF%B4%E6%98%8E + if(window && window.location && window.location.protocol==="https:"){ + uploadEndPoint = "https://up.qbox.me"; + } + var defaultsSetting = { chunkSize: 1024 * 1024 * 4, mkblkEndPoint: uploadEndPoint + '/mkblk/', @@ -257,4 +262,4 @@ angular.module('angularQFileUpload').directive('ngFileSelect', ['$parse', '$time }); }; } -]); \ No newline at end of file +]);