mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2025-08-11 03:09:25 +00:00
Test curl-impersonate's HTTP headers
Add tests to verify that the HTTP headers and HTTP/2 pseudo-headers generated by curl-impersonate match the expected ones from the browser. The test uses a local nghttpd HTTP/2 server instance with a self-signed certificate.
This commit is contained in:
@@ -15,10 +15,10 @@ docker run --rm curl-impersonate-tests
|
||||
This simply runs `pytest` in the container. You can pass additional flags to `pytest` such as `--log-cli-level DEBUG`.
|
||||
|
||||
## How the tests work
|
||||
For each supported browser, a packet capture is started while `curl-impersonate` is run with the relevant wrapper script. The Client Hello message is extracted from the capture, and compared against the known signature of the browser.
|
||||
For each supported browser, the following tests are performed:
|
||||
* A packet capture is started while `curl-impersonate` is run with the relevant wrapper script. The Client Hello message is extracted from the capture and compared against the known signature of the browser.
|
||||
* `curl-impersonate` is run, connecting to a local `nghttpd` server (a simple HTTP/2 server). The HTTP/2 pseudo-headers and headers are extracted from the output log of `nghttpd` and compared to the known headers of the browser.
|
||||
|
||||
## What's missing
|
||||
The following tests are still missing:
|
||||
* Test that `curl-impersonate` sends the HTTP headers in the same order as the browser.
|
||||
* Test that `curl-impersonate` sends the HTTP/2 pseudo-headers in the same order as the browser.
|
||||
* Test that `curl-impersonate` sends the same HTTP/2 SETTINGS as the browser.
|
||||
|
Reference in New Issue
Block a user