We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9a54299 + 6228b9d commit 8a488a2Copy full SHA for 8a488a2
qiniu/rs.js
@@ -267,8 +267,10 @@ GetPolicy.prototype.makeRequest = function(baseUrl, mac) {
267
268
return baseUrl + '&token=' + downloadToken;
269
}
270
+
271
+// domain maybe 'http://hello.qiniu.com', 'https://hello.qiniu.com' and 'hello.qiniu.com'
272
// query like '-thumbnail', '?imageMogr2/thumbnail/960x' and so on
273
function makeBaseUrl(domain, key, query) {
274
key = new Buffer(key);
- return 'http://' + domain + '/' + querystring.escape(key) + (query || '');
275
+ return (/^https?:\/\//.test(domain) ? domain : 'http://' + domain) + '/' + querystring.escape(key) + (query || '');
276
0 commit comments