Skip to content

Commit

Permalink
fix: update content-type whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabolol committed Dec 13, 2023
1 parent 6db4a28 commit dda0051
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @modifications
* - Removed deprecated interface `ConnInfo`
* - Refactored `handler` to make it fresh-agnostic
* - Only report `svg` files
*
* @license MIT The original work is licensed under the MIT License.
* {@link https://github.com/denoland/ga4/blob/main/LICENSE.md}
Expand Down Expand Up @@ -51,7 +52,7 @@ function ga4(

let event: Event | null = null;
const contentType = response.headers.get("content-type");
if (/text\/html/.test(contentType!)) {
if (/image\/svg\+xml/.test(contentType!)) {
event = { name: "page_view", params: {} }; // Probably an old browser.
}

Expand Down

0 comments on commit dda0051

Please sign in to comment.