File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change 1- import { canonicalHeaderKey } from '@/rules/utils'
21import { ProxyData , RequestSnippetSchema } from '@/types'
32import { getLocationHeader , getUpgradeHeader } from '@/utils/headers'
43
54const HEADERS_TO_EXCLUDE = [
65 // Managed by k6 automatically
7- 'Cookie ' ,
8- 'User-Agent ' ,
9- 'Host ' ,
10- 'Content-Length ' ,
6+ 'cookie ' ,
7+ 'user-agent ' ,
8+ 'host ' ,
9+ 'content-length ' ,
1110
1211 // Transport/connection
13- 'Connection ' ,
14- 'Accept-Encoding ' ,
15- 'Te ' ,
16- 'Transfer-Encoding ' ,
12+ 'connection ' ,
13+ 'accept-encoding ' ,
14+ 'te ' ,
15+ 'transfer-encoding ' ,
1716
1817 // Browser cache (k6 has no cache)
19- 'Cache-Control ' ,
20- 'Pragma ' ,
18+ 'cache-control ' ,
19+ 'pragma ' ,
2120
2221 // Browser-specific behavior
23- 'Upgrade-Insecure-Requests ' ,
24- 'Dnt ' ,
25- 'Priority ' ,
22+ 'upgrade-insecure-requests ' ,
23+ 'dnt ' ,
24+ 'priority ' ,
2625
2726 // Browser preferences
28- 'Accept-Language ' ,
27+ 'accept-language ' ,
2928]
3029
3130// Browser security metadata headers — prefix match covers all
@@ -176,7 +175,7 @@ export function shouldIncludeHeaderInScript(key: string) {
176175 if ( HEADER_PREFIXES_TO_EXCLUDE . some ( ( prefix ) => lower . startsWith ( prefix ) ) ) {
177176 return false
178177 }
179- return ! HEADERS_TO_EXCLUDE . includes ( canonicalHeaderKey ( key ) )
178+ return ! HEADERS_TO_EXCLUDE . includes ( lower )
180179}
181180
182181export function generateScriptHeader ( ) {
You can’t perform that action at this time.
0 commit comments