Skip to content

Commit

Permalink
Merge pull request #1956 from bower/strip-trailing-slash
Browse files Browse the repository at this point in the history
strip trailing slash in urlResolver
  • Loading branch information
sheerun committed Oct 24, 2015
2 parents eaa05ac + 452217e commit b79034f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/core/resolvers/UrlResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,18 @@ UrlResolver.prototype._resolve = function () {

// -----------------

UrlResolver.prototype._parseSourceURL = function (_url) {
return url.parse(path.basename(_url)).pathname;
};

UrlResolver.prototype._download = function () {
var fileName = url.parse(path.basename(this._source)).pathname;
var fileName = this._parseSourceURL(this._source);

if (!fileName) {
this._source = this._source.replace(/\/(?=\?|#)/, '');
fileName = this._parseSourceURL(this._source);
}

var file = path.join(this._tempDir, fileName);
var reqHeaders = {};
var that = this;
Expand Down

0 comments on commit b79034f

Please sign in to comment.