@@ -2,25 +2,25 @@ import { CURRENT_VERSION, TELEMETRY_PIXEL } from '@/lib/constants';
22
33export async function GET ( ) {
44 if (
5- process . env . NODE_ENV !== 'production' &&
6- process . env . DISABLE_TELEMETRY &&
5+ process . env . NODE_ENV !== 'production' ||
6+ process . env . DISABLE_TELEMETRY ||
77 process . env . PRIVATE_MODE
88 ) {
9- const script = `
10- (()=>{const i=document.createElement('img');
11- i.setAttribute('src','${ TELEMETRY_PIXEL } ?v=${ CURRENT_VERSION } ');
12- i.setAttribute('style','width:0;height:0;position:absolute;pointer-events:none;');
13- document.body.appendChild(i);})();
14- ` ;
15-
16- return new Response ( script . replace ( / \s \s + / g, '' ) , {
9+ return new Response ( '/* telemetry disabled */' , {
1710 headers : {
1811 'content-type' : 'text/javascript' ,
1912 } ,
2013 } ) ;
2114 }
2215
23- return new Response ( '/* telemetry disabled */' , {
16+ const script = `
17+ (()=>{const i=document.createElement('img');
18+ i.setAttribute('src','${ TELEMETRY_PIXEL } ?v=${ CURRENT_VERSION } ');
19+ i.setAttribute('style','width:0;height:0;position:absolute;pointer-events:none;');
20+ document.body.appendChild(i);})();
21+ ` ;
22+
23+ return new Response ( script . replace ( / \s \s + / g, '' ) , {
2424 headers : {
2525 'content-type' : 'text/javascript' ,
2626 } ,
0 commit comments