(browser: Literal['chrome', 'firefox'] | None, ja4: str)
| 66 | ], |
| 67 | ) |
| 68 | def test_ja4_fingerprint(browser: Literal['chrome', 'firefox'] | None, ja4: str) -> None: |
| 69 | impit = Client(browser=browser) |
| 70 | response = impit.get('https://headers.superuser.one/') |
| 71 | assert response.status_code == 200 |
| 72 | found_ja4 = False |
| 73 | for line in response.text.split('\n'): |
| 74 | if line.startswith('cf-ja4 => '): |
| 75 | assert line == f'cf-ja4 => {ja4}' |
| 76 | found_ja4 = True |
| 77 | break |
| 78 | assert found_ja4, "Expected 'cf-ja4' header line not found in response" |
| 79 | |
| 80 | |
| 81 | @pytest.mark.parametrize( |