Merge branch 'main' into fix/tls13-fatal-alert-after-handshake · mitmproxy/mitmproxy@b39a278 · GitHub
Skip to content

Commit b39a278

Browse files
committed
Merge branch 'main' into fix/tls13-fatal-alert-after-handshake
# Conflicts: # CHANGELOG.md
2 parents 1e39655 + c8a55ff commit b39a278

24 files changed

Lines changed: 308 additions & 79 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions

‎docs/scripts/clirecording/screenplays.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def record_intercept_requests(d: CliDirector):
153153

154154
d.focus_pane(pane_top)
155155

156-
d.message("You see a new line in in the list of flows.")
156+
d.message("You see a new line in the list of flows.")
157157
d.message(
158158
"The new flow is displayed in red to indicate that it has been intercepted."
159159
)

‎docs/src/content/howto/transparent-vms.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ sudo restart network-manager
5656

5757
afterwards.
5858

59-
Now, dnsmasq can be be installed and configured:
59+
Now, dnsmasq can be installed and configured:
6060

6161
```bash
6262
sudo apt-get install dnsmasq

‎examples/contrib/save_streamed_data.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
If the option 'save_streamed_data' is set to a format string then
55
streamed requests and responses are written to individual files with a name
6-
derived from the string. Apart from python strftime() formating (using the
6+
derived from the string. Apart from python strftime() formatting (using the
77
request start time) the following codes can also be used:
88
- %+T: The time stamp of the request with microseconds
99
- %+D: 'req' or 'rsp' indicating the direction of the data
@@ -95,7 +95,7 @@ def load(loader):
9595
Optional[str],
9696
None,
9797
"Format string for saving streamed data to files. If set each streamed request or response is written "
98-
"to a file with a name derived from the string. In addition to formating supported by python "
98+
"to a file with a name derived from the string. In addition to formatting supported by python "
9999
"strftime() (using the request start time) the code '%+T' is replaced with the time stamp of the request, "
100100
"'%+D' by 'req' or 'rsp' depending on the direction of the data, '%+C' by the client IP addresses and "
101101
"'%+I' by the client connection ID.",

‎examples/contrib/suppress_error_responses.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
This script suppresses the 502 Bad Gateway messages, mitmproxy sends if the server is not responsing correctly.
2+
This script suppresses the 502 Bad Gateway messages, mitmproxy sends if the server is not responding correctly.
33
For example, this functionality can be helpful if mitmproxy is used in between a web scanner and a web application.
44
Without this script, if the web application under test crashes, mitmproxy will send 502 Bad Gateway responses.
55
These responses are irritating the web application scanner since they obfuscate the actual problem.

‎mitmproxy/addons/save.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def load(self, loader):
5353
None,
5454
"""
5555
Stream flows to file as they arrive. Prefix path with + to append.
56-
The full path can use python strftime() formating, missing
56+
The full path can use python strftime() formatting, missing
5757
directories are created as needed. A new file is opened every time
5858
the formatted string changes.
5959
""",

‎mitmproxy/addons/view.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _refilter(self):
262262
@command.command("view.focus.go")
263263
def go(self, offset: int) -> None:
264264
"""
265-
Go to a specified offset. Positive offests are from the beginning of
265+
Go to a specified offset. Positive offsets are from the beginning of
266266
the view, negative from the end of the view, so that 0 is the first
267267
flow, -1 is the last flow.
268268
"""

‎mitmproxy/net/http/cookies.py‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ def _read_cookie_pairs(s, off=0):
136136
return pairs, off
137137

138138

139+
_WEEKDAYS = {
140+
"mon",
141+
"tue",
142+
"wed",
143+
"thu",
144+
"fri",
145+
"sat",
146+
"sun",
147+
"monday",
148+
"tuesday",
149+
"wednesday",
150+
"thursday",
151+
"friday",
152+
"saturday",
153+
"sunday",
154+
}
155+
156+
139157
def _read_set_cookie_pairs(s: str, off=0) -> tuple[list[TPairs], int]:
140158
"""
141159
Read pairs of lhs=rhs values from SetCookie headers while handling multiple cookies.
@@ -156,15 +174,11 @@ def _read_set_cookie_pairs(s: str, off=0) -> tuple[list[TPairs], int]:
156174

157175
# Special handling of attributes
158176
if lhs.lower() == "expires":
159-
# 'expires' values can contain commas in them so they need to
160-
# be handled separately.
161-
162-
# We actually bank on the fact that the expires value WILL
163-
# contain a comma. Things will fail, if they don't.
164-
165-
# '3' is just a heuristic we use to determine whether we've
166-
# only read a part of the expires value and we should read more.
167-
if len(rhs) <= 3:
177+
# 'expires' date values can contain a comma after the weekday
178+
# (e.g. RFC 1123 'Wed, ...' or RFC 850 'Wednesday, ...').
179+
# We only consume across a comma if the delimiter encountered
180+
# is actually a comma and the value read so far is a weekday.
181+
if off < len(s) and s[off] == "," and rhs.strip().lower() in _WEEKDAYS:
168182
trail, off = _read_value(s, off + 1, ";,")
169183
rhs = rhs + "," + trail
170184

‎mitmproxy/net/http/http1/read.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def get_header_tokens(headers, key):
1414
"""
1515
Retrieve all tokens for a header key. A number of different headers
16-
follow a pattern where each header line can containe comma-separated
16+
follow a pattern where each header line can contain comma-separated
1717
tokens, and headers can be set multiple times.
1818
"""
1919
if key not in headers:

‎mitmproxy/proxy/layers/http/_http2.py‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)