We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c7a0e0 commit 43e47fcCopy full SHA for 43e47fc
1 file changed
src/lib/dry-run/samples.ts
@@ -865,12 +865,9 @@ export function findSample(
865
const pathOnly = extractPath(url);
866
for (const e of ENTRIES) {
867
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 };
+ // Rebind body so downstream code can call `e.body` as before while
+ // still preserving the original lazy factory semantics.
+ return { ...e, body: () => e.body(requestBody) };
874
}
875
876
return undefined;
0 commit comments