Added decoding to URL elements.
This commit is contained in:
@@ -10,6 +10,7 @@ import { createToken, parseToken } from '@/lib/jwt';
|
|||||||
import { secret, uuid, hash } from '@/lib/crypto';
|
import { secret, uuid, hash } from '@/lib/crypto';
|
||||||
import { COLLECTION_TYPE } from '@/lib/constants';
|
import { COLLECTION_TYPE } from '@/lib/constants';
|
||||||
import { anyObjectParam, urlOrPathParam } from '@/lib/schema';
|
import { anyObjectParam, urlOrPathParam } from '@/lib/schema';
|
||||||
|
import { safeDecodeURI, safeDecodeURIComponent } from '@/lib/url';
|
||||||
import { createSession, saveEvent, saveSessionData } from '@/queries';
|
import { createSession, saveEvent, saveSessionData } from '@/queries';
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@@ -168,12 +169,12 @@ export async function POST(request: Request) {
|
|||||||
websiteId,
|
websiteId,
|
||||||
sessionId,
|
sessionId,
|
||||||
visitId,
|
visitId,
|
||||||
urlPath,
|
urlPath: safeDecodeURI(urlPath),
|
||||||
urlQuery,
|
urlQuery,
|
||||||
referrerPath,
|
referrerPath: safeDecodeURI(referrerPath),
|
||||||
referrerQuery,
|
referrerQuery,
|
||||||
referrerDomain,
|
referrerDomain,
|
||||||
pageTitle: title,
|
pageTitle: safeDecodeURIComponent(title),
|
||||||
eventName: name,
|
eventName: name,
|
||||||
eventData: data,
|
eventData: data,
|
||||||
hostname: hostname || urlDomain,
|
hostname: hostname || urlDomain,
|
||||||
|
|||||||
Reference in New Issue
Block a user