Skip to content

Commit

Permalink
fixbug setScheme
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchonghua committed Jan 4, 2018
1 parent 511bdd8 commit dd91032
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/AuthSha256/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Object.assign(AuthSha256Prototype, {
uri = uri || ''
// 解析uri
uriObj = url.parse(uri)
if (typeof uriObj['scheme'] !== 'undefined' && uriObj['scheme']) {
this.setScheme(uriObj['scheme'])
}
if (typeof uriObj['host'] !== 'undefined' && uriObj['host']) {
this.setHost(uriObj['host'])
}
Expand Down Expand Up @@ -128,6 +131,10 @@ Object.assign(AuthSha256Prototype, {
this.host = (typeof host === 'undefined' || (!host)) ? '' : host
return this
},
setScheme: function setScheme (scheme) {
this.scheme = (typeof scheme === 'undefined' || (!scheme)) ? '' : scheme
return this
},
/**
* 设置请求参数
* @param {Array} query [请求参数]
Expand Down

0 comments on commit dd91032

Please # to comment.