Merge pull request #140 from Redrield/fix/dedup-reason

Deduplicate the reason line in HTTP responses
pull/146/head
Daniel Abramov 4 years ago committed by GitHub
commit 31e087f325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/handshake/server.rs

@ -89,10 +89,9 @@ pub fn create_response(request: &Request) -> Result<Response> {
fn write_response<T>(w: &mut dyn io::Write, response: &HttpResponse<T>) -> Result<()> {
writeln!(
w,
"{version:?} {status} {reason}\r",
"{version:?} {status}\r",
version = response.version(),
status = response.status(),
reason = response.status().canonical_reason().unwrap_or(""),
status = response.status()
)?;
for (k, v) in response.headers() {

Loading…
Cancel
Save