Skip to content

Commit

Permalink
fix: remove replace %20 to '+' (#489)
Browse files Browse the repository at this point in the history
* fix: remove replace %20 to '+'

* fix : eslint
  • Loading branch information
luozhang002 authored and binghaiwang committed Jun 13, 2018
1 parent bf546ce commit 22363d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/browser/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ proto._getReqUrl = function _getReqUrl(params) {

if (params.object) {
// Preserve '/' in result url
reourcePath += this._escape(params.object);
reourcePath += this._escape(params.object).replace(/\+/g, '%2B');
}
ep.pathname = reourcePath;

Expand All @@ -391,7 +391,7 @@ proto._getReqUrl = function _getReqUrl(params) {
ep.query = query;

// As '%20' is not recognized by OSS server, we must convert it to '+'.
return urlutil.format(ep).replace(/%20/g, '+');
return urlutil.format(ep);
};

/*
Expand Down
4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ proto._getReqUrl = function _getReqUrl(params) {

if (params.object) {
// Preserve '/' in result url
resourcePath += this._escape(params.object);
resourcePath += this._escape(params.object).replace(/\+/g, '%2B');
}
ep.pathname = resourcePath;

Expand All @@ -378,7 +378,7 @@ proto._getReqUrl = function _getReqUrl(params) {
ep.query = query;

// As '%20' is not recognized by OSS server, we must convert it to '+'.
return urlutil.format(ep).replace(/%20/g, '+');
return urlutil.format(ep);
};

/*
Expand Down

0 comments on commit 22363d0

Please sign in to comment.