Skip to content

Commit 3057608

Browse files
committed
Update 2xx colour and add for 1xx and 3xx
1 parent 4c6add7 commit 3057608

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/_colorize.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ class HttpServer(ThemeSection):
206206
path: str = ANSIColors.CYAN
207207
serving: str = ANSIColors.GREEN
208208
size: str = ANSIColors.GREY
209-
status_ok: str = ANSIColors.BLUE
209+
status_informational: str = ANSIColors.RESET
210+
status_ok: str = ANSIColors.GREEN
211+
status_redirect: str = ANSIColors.INTENSE_CYAN
210212
status_client_error: str = ANSIColors.YELLOW
211213
status_server_error: str = ANSIColors.RED
212214
timestamp: str = ANSIColors.GREY

Lib/http/server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,12 @@ def _colorize_request(self, code, size, t):
586586
code_color = t.status_server_error
587587
elif code_int >= 400:
588588
code_color = t.status_client_error
589-
else:
589+
elif code_int >= 300:
590+
code_color = t.status_redirect
591+
elif code_int >= 200:
590592
code_color = t.status_ok
593+
else:
594+
code_color = t.status_informational
591595

592596
request_line = self.requestline.translate(self._control_char_table)
593597
parts = request_line.split(None, 2)

0 commit comments

Comments
 (0)