Skip to content

Commit 4e48329

Browse files
authored
feat(testStandby): allow for custom paths and headers (#77)
1 parent f3b1752 commit 4e48329

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/lib.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,14 @@ export const it = testActor;
143143
*/
144144
const createStartStandbyFn = <I, O>(standbyTask: StandbyTask) => {
145145
const { standbyUrl } = standbyTask;
146-
return async ({ input }: Pick<RunOptions<I>, 'input'>) => {
147-
const response = await fetch(standbyUrl, {
146+
return async ({
147+
input,
148+
path = '',
149+
headers = {},
150+
}: Pick<RunOptions<I>, 'input'> & { path?: string; headers?: Record<string, string> }) => {
151+
const response = await fetch(standbyUrl + path, {
148152
headers: {
153+
...headers,
149154
Authorization: `Bearer ${apifyClient.token}`,
150155
},
151156
method: 'POST',

0 commit comments

Comments
 (0)