Skip to content

Commit

Permalink
Ignore favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Jan 22, 2024
1 parent 534c2f9 commit 96af7c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arb-gateway/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ const logResult = async (
request: CFWRequest,
result: Response
): Promise<Response> => {
if (request.url.match(/favicon/)) {
return result;
}
if (!result.body) {
return result;
}
const [streamForLog, streamForResult] = result.body.tee();
const logResult = await new Response(streamForLog).json();

const logResultData = logResult.data.substring(0, 200)
await tracker.trackEvent(
'result',
request,
{ props: { result: logResult.data.substring(0, 200) } },
{ props: { result: logResultData } },
true
);
return new Response(streamForResult, result);
Expand Down

0 comments on commit 96af7c6

Please sign in to comment.