Permalink
Browse files

get use http. it is faster

  • Loading branch information...
Hsiaoming Yang
Hsiaoming Yang committed Mar 20, 2013
1 parent c96037a commit b0ff73e682e23b81ca916393b5f8addac782d344
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/sdk/yuan.js
View
@@ -35,6 +35,12 @@ function Yuan(options) {
Yuan.prototype.request = function(data, callback) {
data.url = util.format('%s/%s', this.server, data.urlpath);
+ if (data.method.toLowerCase() === 'get') {
+ // http is faster
+ data.url = data.url.replace(
+ /^https\:\/\/spmjs\.org/, 'http://spmjs.org'
+ );
+ }
log.debug(data.method.toLowerCase(), data.url);
data.headers = data.headers || {};

0 comments on commit b0ff73e

Please sign in to comment.