Skip to content

Commit

Permalink
Truncate strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Mar 27, 2021
1 parent 9415fe9 commit b24b855
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export async function savePageView(website_id, session_id, url, referrer) {
data: {
website_id,
session_id,
url: url.substr(0, URL_LENGTH),
referrer: referrer.substr(0, URL_LENGTH),
url: url?.substr(0, URL_LENGTH),
referrer: referrer?.substr(0, URL_LENGTH),
},
}),
);
Expand All @@ -197,9 +197,9 @@ export async function saveEvent(website_id, session_id, url, event_type, event_v
data: {
website_id,
session_id,
url: url.substr(0, URL_LENGTH),
event_type,
event_value,
url: url?.substr(0, URL_LENGTH),
event_type: event_type?.substr(0, 50),
event_value: event_value?.substr(0, 50),
},
}),
);
Expand Down

0 comments on commit b24b855

Please sign in to comment.