Fix referrer lookup.

This commit is contained in:
Mike Cao 2023-04-02 22:41:24 -07:00
parent ba71f5cafc
commit ae772f048c

View File

@ -117,7 +117,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
urlPath = '/';
}
if (referrerPath.startsWith('http')) {
if (referrerPath?.startsWith('http')) {
const refUrl = new URL(referrer);
referrerPath = refUrl.pathname;
referrerQuery = refUrl.search.substring(1);