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 99b9c35 commit 2919925Copy full SHA for 2919925
1 file changed
src/lib/dry-run/samples.ts
@@ -906,12 +906,9 @@ export function findSample(
906
const pathOnly = extractPath(url);
907
for (const e of ENTRIES) {
908
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 };
+ // 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) };
915
}
916
917
return undefined;
0 commit comments