Skip to content

Commit

Permalink
make the isDirectory check simpler and more inclusive of error states
Browse files Browse the repository at this point in the history
  • Loading branch information
4141done committed Aug 18, 2023
1 parent 29e8973 commit 61bea6b
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions common/etc/nginx/include/s3gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,18 +451,9 @@ function _escapeURIPath(uri) {
* @private
*/
function _isDirectory(path) {
// if (!path) return false;
// str.slice(-1);
if (path === undefined) {
return false;
}
const len = path.length;

if (len < 1) {
return false;
}
if (!path) return false;

return path.charAt(len - 1) === '/';
return path.slice(-1) === '/';
}

/**
Expand Down

0 comments on commit 61bea6b

Please sign in to comment.