Skip to content

Commit

Permalink
Fix missing slash in path variable
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Sep 6, 2023
1 parent 4833bb0 commit 62d9ff6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/database/foxx/api/authz_router.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ router.get('/gridftp', function(req, res) {
throw g_lib.ERR_PERM_DENIED;
}

// If path is missing the starting "/" add it back in
if (!path.startsWith("/") && alloc.path.startsWith("/") ) {
path = "/" + path;
}

console.log("path:", path, " alloc path:", alloc.path + data_key, " loc: ", loc);
console.log("13");
if (alloc.path + data_key != path) {
// This may be due to an alloc/owner change
Expand Down Expand Up @@ -246,4 +252,4 @@ router.get('/perm/get', function(req, res) {
.queryParam('id', joi.string().required(), "Object ID or alias")
.queryParam('perms', joi.number().optional(), "Permission bit mask to get (default = all)")
.summary('Gets client permissions for object')
.description('Gets client permissions for object (projects, data, collections. Note this is potentially slower than using "check" method.');
.description('Gets client permissions for object (projects, data, collections. Note this is potentially slower than using "check" method.');

0 comments on commit 62d9ff6

Please sign in to comment.