Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Oct 4, 2024
1 parent bf4f6a4 commit e531ee4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/web/lib/middleware/utils/detect-bot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const detectBot = (req: Request) => {
const searchParams = new URLSearchParams(req.url);
const searchParams = new URL(req.url).searchParams;
if (searchParams.get("bot")) return true;
const ua = req.headers.get("User-Agent");
if (ua) {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/middleware/utils/detect-qr.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const detectQr = (req: Request) => {
const searchParams = new URLSearchParams(req.url);
const searchParams = new URL(req.url).searchParams;
if (searchParams.get("qr") === "1") return true;
return false;
};
2 changes: 1 addition & 1 deletion apps/web/lib/middleware/utils/get-final-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const getFinalUrlForRecordClick = ({
req: Request;
url: string;
}) => {
const searchParams = new URLSearchParams(req.url);
const searchParams = new URL(url).searchParams;
const urlObj = new URL(url);

// Filter out query params that are not in the allowed list
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/tinybird/record-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function recordClick({
webhookIds?: string[];
skipRatelimit?: boolean;
}) {
const searchParams = new URLSearchParams(req.url);
const searchParams = new URL(req.url).searchParams;

// only track the click when there is no `dub-no-track` header or query param
if (
Expand Down

0 comments on commit e531ee4

Please sign in to comment.