File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ Status: [success - 200]
55### Request Headers
66- accept-language:en-US,en;q=0.9
77- upgrade-insecure-requests:1
8- - user-agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/141.0.0.0 Safari/537.36
9- - sec-ch-ua:"Chromium";v="141 ", "Not?A_Brand";v="8"
8+ - user-agent:<user-agent>
9+ - sec-ch-ua:"Chromium";v="<version> ", "Not?A_Brand";v="8"
1010- sec-ch-ua-mobile:?0
11- - sec-ch-ua-platform:"Linux "
11+ - sec-ch-ua-platform:"<os> "
1212### Response Headers
1313- connection:keep-alive
1414- content-length:239
Original file line number Diff line number Diff line change @@ -137,8 +137,19 @@ export function stabilizeResponseOutput(text: unknown) {
137137 }
138138 let output = text ;
139139 const dateRegEx = / .{ 3 } , \d { 2 } .{ 3 } \d { 4 } \d { 2 } : \d { 2 } : \d { 2 } [ A - Z ] { 3 } / g;
140- const localhostRegEx = / h t t p : \/ \/ l o c a l h o s t : \d { 5 } \/ / g;
141140 output = output . replaceAll ( dateRegEx , '<long date>' ) ;
141+
142+ const localhostRegEx = / h t t p : \/ \/ l o c a l h o s t : \d { 5 } \/ / g;
142143 output = output . replaceAll ( localhostRegEx , 'http://localhost:<port>/' ) ;
144+
145+ const userAgentRegEx = / u s e r - a g e n t : .* \n / g;
146+ output = output . replaceAll ( userAgentRegEx , 'user-agent:<user-agent>\n' ) ;
147+
148+ const chUaRegEx = / s e c - c h - u a : " C h r o m i u m " ; v = " \d { 3 } " / g;
149+ output = output . replaceAll ( chUaRegEx , 'sec-ch-ua:"Chromium";v="<version>"' ) ;
150+
151+ // sec-ch-ua-platform:"Linux"
152+ const chUaPlatformRegEx = / s e c - c h - u a - p l a t f o r m : " [ a - z A - Z ] * " / g;
153+ output = output . replaceAll ( chUaPlatformRegEx , 'sec-ch-ua-platform:"<os>"' ) ;
143154 return output ;
144155}
You can’t perform that action at this time.
0 commit comments