Skip to content

Commit c8a0489

Browse files
committed
Fixed User Agent String
1 parent 36f6df1 commit c8a0489

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

workshop/petclinic/deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,9 @@ data:
665665
const puppeteer = require('puppeteer');
666666
function run () {
667667
return new Promise(async (resolve, reject) => {
668+
const customUserAgent = 'Mozilla/5.0 (X11; Linux x86_64; Splunk RUM_LoadGen) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36';
669+
console.log('DEBUG: Using User Agent:', customUserAgent);
670+
668671
const browser = await puppeteer.launch({
669672
headless: true,
670673
defaultViewport: null,
@@ -682,15 +685,15 @@ data:
682685
'--disable-background-timer-throttling',
683686
'--disable-backgrounding-occluded-windows',
684687
'--disable-renderer-backgrounding',
685-
'--memory-pressure-off'
688+
'--memory-pressure-off',
689+
`--user-agent=${customUserAgent}`
686690
]
687691
});
688692
try {
689693
const wait_time = 500; //Set up delay between page interactions
690694
for (let loop=0; loop < 1;loop++) { // as part of the load we run multiple of this script to generate multiple session
691695
const context = await browser.createBrowserContext();
692696
const page = await context.newPage();
693-
await page.setUserAgent('Mozilla/5.0 (X11; Linux x86_64; Splunk RUMLoadGen) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.7339.133 Safari/537.36')
694697
const urls= [process.env.RUM_FRONTEND_IP + "/#!/welcome"];
695698
const timeout = 30000;
696699
for (const element of urls) {

0 commit comments

Comments
 (0)