mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Nicer coloring for HTTP response codes.
20x: green 30x: blue 40x: orange 50x: light red other (non-standard or uncommon): dark red
This commit is contained in:
parent
c02fdb2463
commit
bb03255da0
@ -137,17 +137,17 @@ def raw_format_flow(f, focus, extended, padding):
|
||||
)
|
||||
|
||||
if f["resp_code"]:
|
||||
if f["resp_code"] in [200, 304]:
|
||||
resp.append(fcol(SYMBOL_RETURN, "goodcode"))
|
||||
else:
|
||||
resp.append(fcol(SYMBOL_RETURN, "error"))
|
||||
codes = {
|
||||
2: "code_200",
|
||||
3: "code_300",
|
||||
4: "code_400",
|
||||
5: "code_500",
|
||||
}
|
||||
ccol = codes.get(f["resp_code"]/100, "code_other")
|
||||
resp.append(fcol(SYMBOL_RETURN, ccol))
|
||||
if f["resp_is_replay"]:
|
||||
resp.append(fcol(SYMBOL_REPLAY, "replay"))
|
||||
if f["resp_code"] in [200, 304]:
|
||||
resp.append(fcol(f["resp_code"], "goodcode"))
|
||||
else:
|
||||
resp.append(fcol(f["resp_code"], "error"))
|
||||
|
||||
resp.append(fcol(f["resp_code"], ccol))
|
||||
if f["intercepting"] and f["resp_code"] and not f["resp_acked"]:
|
||||
rc = "intercept"
|
||||
else:
|
||||
|
@ -33,8 +33,15 @@ dark = [
|
||||
# List and Connections
|
||||
('method', 'dark cyan', 'default'),
|
||||
('focus', 'yellow', 'default'),
|
||||
('goodcode', 'light green', 'default'),
|
||||
|
||||
('code_200', 'light green', 'default'),
|
||||
('code_300', 'light blue', 'default'),
|
||||
('code_400', 'light red', 'default', None, "#f60", "default"),
|
||||
('code_500', 'light red', 'default'),
|
||||
('code_other', 'dark red', 'default'),
|
||||
|
||||
('error', 'light red', 'default'),
|
||||
|
||||
('header', 'dark cyan', 'default'),
|
||||
('highlight', 'white,bold', 'default'),
|
||||
('intercept', 'brown', 'default', None, "#f60", "default"),
|
||||
|
Loading…
Reference in New Issue
Block a user