mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
setheaders addon: update docs
This commit is contained in:
parent
ccf7182a11
commit
b90dded940
@ -133,17 +133,22 @@ forwarding is not desired, you can use the --kill (-k) switch to prevent that.
|
|||||||
|
|
||||||
## Set Headers
|
## Set Headers
|
||||||
|
|
||||||
The `setheaders` option lets you specify a set of headers to be added to
|
The `setheaders` option lets you specify a set of headers to be modified.
|
||||||
requests or responses, based on a filter pattern. A `setheaders` expression
|
New headers can be added, and existing headers can be overwritten or removed.
|
||||||
looks like this:
|
A `setheaders` expression looks like this:
|
||||||
|
|
||||||
{{< highlight none >}}
|
{{< highlight none >}}
|
||||||
/patt/name/value
|
/name/value[/filter-expression]
|
||||||
{{< / highlight >}}
|
{{< / highlight >}}
|
||||||
|
|
||||||
Here, **patt** is a mitmproxy filter expression that defines which flows to set
|
Here, **name** and **value** are the header name and the value to set respectively,
|
||||||
headers on, and **name** and **value** are the header name and the value to set
|
e.g., ``/Host/example.org``. An empty **value** removes existing headers with
|
||||||
respectively.
|
**name**, e.g., ``/Host/``. The optional **filter-expression** is a mitmproxy
|
||||||
|
[filter expression]({{< relref "concepts-filters">}}) that defines
|
||||||
|
which flows to modify headers on, e.g., only on responses using ``~s``.
|
||||||
|
Existing headers are overwritten by default.
|
||||||
|
This can be changed using filter-expressions, e.g., ``!~h Host:`` to ignore
|
||||||
|
requests and responses with an existing ``Host`` header.
|
||||||
|
|
||||||
## Sticky auth
|
## Sticky auth
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user