fix GET/POST route in recorder
This commit is contained in:
+11
-5
@@ -12,14 +12,20 @@ import { record } from 'rrweb';
|
|||||||
|
|
||||||
const website = config('website-id');
|
const website = config('website-id');
|
||||||
const hostUrl = config('host-url');
|
const hostUrl = config('host-url');
|
||||||
|
const configHostUrl = config('config-host-url');
|
||||||
|
|
||||||
if (!website) return;
|
if (!website) return;
|
||||||
|
|
||||||
const host =
|
const scriptHost = currentScript.src.split('/').slice(0, -1).join('/');
|
||||||
hostUrl || '__COLLECT_API_HOST__' || currentScript.src.split('/').slice(0, -1).join('/');
|
const collectHost = hostUrl || '__COLLECT_API_HOST__' || scriptHost;
|
||||||
const hostBase = host.replace(/\/$/, '');
|
const configHost = configHostUrl || scriptHost || collectHost;
|
||||||
const endpoint = `${hostBase}__COLLECT_REPLAY_ENDPOINT__`;
|
const collectHostBase = collectHost.replace(/\/$/, '');
|
||||||
const configEndpoint = `${hostBase}__RECORDER_CONFIG_ENDPOINT__`.replace('{websiteId}', website);
|
const configHostBase = configHost.replace(/\/$/, '');
|
||||||
|
const endpoint = `${collectHostBase}__COLLECT_REPLAY_ENDPOINT__`;
|
||||||
|
const configEndpoint = `${configHostBase}__RECORDER_CONFIG_ENDPOINT__`.replace(
|
||||||
|
'{websiteId}',
|
||||||
|
website,
|
||||||
|
);
|
||||||
|
|
||||||
const REPLAY_FLUSH_EVENT_COUNT = 100;
|
const REPLAY_FLUSH_EVENT_COUNT = 100;
|
||||||
const REPLAY_FLUSH_INTERVAL = 10000;
|
const REPLAY_FLUSH_INTERVAL = 10000;
|
||||||
|
|||||||
Reference in New Issue
Block a user