From 74a2b5b25c85e4be895952c9055ea4319a0f56f9 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Tue, 19 Nov 2024 08:17:54 +0900 Subject: [PATCH] chore: skip 404 state (#107) --- .pre-commit-config.yaml | 6 +++--- routes/_middleware.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 805299f..e585c6e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,15 @@ repos: - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.8.2 + rev: v8.16.0 hooks: - id: cspell - repo: https://github.com/hadolint/hadolint - rev: v2.12.0 + rev: v2.13.1-beta hooks: - id: hadolint - repo: local hooks: - - id: secretlint + - id: secretlint name: secretlint language: docker_image entry: secretlint/secretlint:latest secretlint diff --git a/routes/_middleware.ts b/routes/_middleware.ts index f677454..3b10913 100644 --- a/routes/_middleware.ts +++ b/routes/_middleware.ts @@ -65,6 +65,9 @@ function ga4( if (conn.url.pathname === "/healthz") { return; } + if (response.status === 404) { + return; + } // Create basic report. const measurementId = GA4_MEASUREMENT_ID;