| @@ -521,8 +521,7 @@ fn read_request( |
| 521 | 521 | , at: Int |
| 522 | 522 | ) -> Result<Incoming, Failure> / <io, proc> { |
| 523 | 523 | match parse_head(buffer, at) { |
| 524 | | − Partial -> if bytes.length(buffer) |
| 525 | | − > at { |
| 524 | + Partial -> if bytes.length(buffer) > at { |
| 526 | 525 | // A head has begun: it must arrive whole within `head_timeout`. |
| 527 | 526 | process.send(activity, HeadStarted) |
| 528 | 527 | let begun = bytes.slice(buffer, at, bytes.length(buffer)) |
| @@ -668,8 +667,7 @@ fn read_body( |
| 668 | 667 | // Two framings: reading the wrong one would desynchronize the |
| 669 | 668 | // connection (request smuggling). |
| 670 | 669 | Error(Bad(400, "bad request: both Content-Length and Transfer-Encoding")) |
| 671 | | − } else if string.to_lower(string.trim(coding)) |
| 672 | | − == "chunked" { |
| 670 | + } else if string.to_lower(string.trim(coding)) == "chunked" { |
| 673 | 671 | continue_if_expected(conn, headers, buffer, at) |
| 674 | 672 | read_chunks(conn, activity, max_body, buffer, at, bytes.builder(), 0) |
| 675 | 673 | } else { |
| @@ -699,8 +697,7 @@ fn too_large_error() -> Failure { |
| 699 | 697 | /// body. |
| 700 | 698 | fn continue_if_expected(conn, headers, buffer: Bytes, at: Int) -> () / <io> { |
| 701 | 699 | let expect = option.map(find_header(headers, "expect"), string.to_lower) |
| 702 | | − if expect == Some("100-continue") |
| 703 | | − && bytes.length(buffer) == at { |
| 700 | + if expect == Some("100-continue") && bytes.length(buffer) == at { |
| 704 | 701 | let _ = net.write_string(conn, "HTTP/1.1 100 Continue\r\n\r\n") |
| 705 | 702 | () |
| 706 | 703 | } else { |