diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index 5ba720f07..d172209e5 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -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: diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 0b80de214..c1d831882 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -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"),