Skip to content

Commit 4acb077

Browse files
committed
Merge pull request #3 from chence/master
fix: add https support
2 parents d0a82f9 + cf1e375 commit 4acb077

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/qupload.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272

7373
var uploadEndPoint = 'http://up.qiniu.com';
7474

75+
// 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
76+
if(window && window.location && window.location.protocol==="https:"){
77+
uploadEndPoint = "https://up.qbox.me";
78+
}
79+
7580
var defaultsSetting = {
7681
chunkSize: 1024 * 1024 * 4,
7782
mkblkEndPoint: uploadEndPoint + '/mkblk/',
@@ -257,4 +262,4 @@ angular.module('angularQFileUpload').directive('ngFileSelect', ['$parse', '$time
257262
});
258263
};
259264
}
260-
]);
265+
]);

0 commit comments

Comments
 (0)