From 138c7282698e7b4b8c3e1e928aa7f40e977c3d0e Mon Sep 17 00:00:00 2001 From: Andre Deutmeyer Date: Sat, 21 Feb 2015 22:11:26 -0800 Subject: [PATCH] bug: index off by one Very minor bug but forceTrailingSlash always adds a / if set to true because the index was off by one. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fa9b4c3..626a180 100644 --- a/src/index.js +++ b/src/index.js @@ -450,7 +450,7 @@ var _this = this; var start = new Date(); config = deepMixIn(config, _this.defaults.httpConfig); - if (_this.defaults.forceTrailingSlash && config.url[config.url.length] !== '/') { + if (_this.defaults.forceTrailingSlash && config.url[config.url.length-1] !== '/') { config.url += '/'; } config.method = config.method.toUpperCase();