Skip to content

Commit 2919925

Browse files
committed
fix(dry-run): keep sample body resolution lazy
1 parent 99b9c35 commit 2919925

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/lib/dry-run/samples.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -906,12 +906,9 @@ export function findSample(
906906
const pathOnly = extractPath(url);
907907
for (const e of ENTRIES) {
908908
if (e.method === upper && e.pattern.test(pathOnly)) {
909-
const body = e.body(requestBody);
910-
// Rebind body so callers get the resolved value, not the factory.
911-
// We return a new object with `body` already applied so downstream
912-
// code can keep calling `e.body` as-before (no API break for tests
913-
// that call `findSample` directly).
914-
return { ...e, body: () => body };
909+
// Rebind body so downstream code can call `e.body` as before while
910+
// still preserving the original lazy factory semantics.
911+
return { ...e, body: () => e.body(requestBody) };
915912
}
916913
}
917914
return undefined;

0 commit comments

Comments
 (0)