Skip to content

Commit f5c6e65

Browse files
committed
chore: update keys and return correct values
1 parent b5d2963 commit f5c6e65

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

plugins/default/webhook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const handler: PluginHandler = async (
107107
responseData: response.data,
108108
requestContext: {
109109
headers,
110-
timeout: 3000,
110+
timeout: parameters.timeout || 3000,
111111
},
112112
};
113113
} catch (e: any) {
@@ -124,7 +124,7 @@ export const handler: PluginHandler = async (
124124
webhookUrl: parameters.webhookURL || 'No URL provided',
125125
requestContext: {
126126
headers: parameters.headers || {},
127-
timeout: 3000,
127+
timeout: parameters.timeout || 3000,
128128
},
129129
// return response body if it's not a ok response and not a timeout error
130130
...(responseData &&

src/middlewares/hooks/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export class HooksManager {
306306
transformed: result.transformed || false,
307307
created_at: createdAt,
308308
log: result.log || null,
309-
failOnError:
309+
fail_on_error:
310310
(check.parameters as Record<string, any>)?.failOnError || false,
311311
};
312312
} catch (err: any) {
@@ -394,7 +394,7 @@ export class HooksManager {
394394
hookResult = {
395395
// if guardrail has error, make verdict false else do the normal check
396396
verdict: checkResults.every(
397-
(result) => result.verdict || (result.error && !result.failOnError)
397+
(result) => result.verdict || (result.error && !result.fail_on_error)
398398
),
399399
id: hook.id,
400400
transformed: checkResults.some((result) => result.transformed),

src/middlewares/hooks/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface GuardrailCheckResult {
8080
};
8181
};
8282
log?: any;
83-
failOnError?: boolean;
83+
fail_on_error?: boolean;
8484
}
8585

8686
export interface GuardrailResult {

0 commit comments

Comments
 (0)