Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
renamed cuttedPath to cutPath
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-aladev committed Aug 9, 2016
1 parent 1293fdb commit 8327173
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ Salti.prototype.handler = function (request, response, nextHandler) {

// Next section deals with
// /{:db}/{:id}, /{:db}/_local/{:id} and /{:db}/{:id}/attachment stuff.
var cuttedPath = this.getPathWithoutPrefix();
if (!cuttedPath) {
var cutPath = this.getPathWithoutPrefix();
if (!cutPath) {
// Required DB Prefix is not valid.
return this.unauthorized(3);
}

var pathParts = cuttedPath.split('/');
var pathParts = cutPath.split('/');
if (pathParts[0] !== '') {
// Sanity check, the first element should always be empty.
return this.unauthorized(4);
Expand All @@ -141,7 +141,7 @@ Salti.prototype.handler = function (request, response, nextHandler) {

else if (pathParts.length === 3 && pathParts[1] === '_local') {
// Is this a thali {:id}?
var isThaliPrefix = cuttedPath.startsWith(Salti.THALI_PREFIX);
var isThaliPrefix = cutPath.startsWith(Salti.THALI_PREFIX);
if (isThaliPrefix) {
// Is /_local/thali_{:id} authorized?
lookupPath = this.dbPrefix + Salti.THALI_PREFIX +
Expand All @@ -150,7 +150,7 @@ Salti.prototype.handler = function (request, response, nextHandler) {
debug('unauthorized thali prefix');
return this.unauthorized(6);
}
var thaliId = cuttedPath.substring(Salti.THALI_PREFIX.length);
var thaliId = cutPath.substring(Salti.THALI_PREFIX.length);
if (!this.resolveThaliId(thaliId)) {
debug('unauthorized thali id');
return this.unauthorized(7);
Expand Down

0 comments on commit 8327173

Please sign in to comment.