Skip to content

Commit 43e47fc

Browse files
committed
fix(dry-run): keep sample body resolution lazy
1 parent 6c7a0e0 commit 43e47fc

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
@@ -865,12 +865,9 @@ export function findSample(
865865
const pathOnly = extractPath(url);
866866
for (const e of ENTRIES) {
867867
if (e.method === upper && e.pattern.test(pathOnly)) {
868-
const body = e.body(requestBody);
869-
// Rebind body so callers get the resolved value, not the factory.
870-
// We return a new object with `body` already applied so downstream
871-
// code can keep calling `e.body` as-before (no API break for tests
872-
// that call `findSample` directly).
873-
return { ...e, body: () => body };
868+
// Rebind body so downstream code can call `e.body` as before while
869+
// still preserving the original lazy factory semantics.
870+
return { ...e, body: () => e.body(requestBody) };
874871
}
875872
}
876873
return undefined;

0 commit comments

Comments
 (0)