Parse the HTTP status code from a response status line. Expects the first line to look like `HTTP/1.1 200 OK`.
(headers: &str)
| 2090 | /// |
| 2091 | /// Expects the first line to look like `HTTP/1.1 200 OK`. |
| 2092 | fn parse_status_code(headers: &str) -> Option<u16> { |
| 2093 | let status_line = headers.lines().next()?; |
| 2094 | let code_str = status_line.split_whitespace().nth(1)?; |
| 2095 | code_str.parse().ok() |
| 2096 | } |
| 2097 | |
| 2098 | /// Check if the response headers contain `Connection: close`. |
| 2099 | fn parse_connection_close(headers: &str) -> bool { |
no test coverage detected