Skip to content

Commit 83d26c1

Browse files
author
Andrea Cosentino
committed
fix: patchWalkPath
1 parent 2be32d1 commit 83d26c1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/utils/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import { ILogger } from "../models/logger.model";
1313

1414
function patchWalkPath(target: any, path: string) {
1515
if (path === '' || path === '/') {
16-
return target;
16+
throw new UniversalApiError(
17+
"PATCH body request malformed: cannot use root path for this operation",
18+
"MANUALLY_HANDLED",
19+
"",
20+
Constants.HTTP_STATUS_CODE.BAD_REQUEST
21+
);
1722
}
1823
const segments = path.split('/').filter(s => s !== '');
1924
let current = target;

0 commit comments

Comments
 (0)