Skip to content

Commit dacb89a

Browse files
committed
Fix content-length typo
1 parent dfb3ee1 commit dacb89a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use async_std::io::{Read, Write};
66
use async_std::prelude::*;
77
use async_std::task::{Context, Poll};
88
use futures_core::ready;
9-
use http_types::headers::{HeaderName, HeaderValue, CONTENT_TYPE};
9+
use http_types::headers::{HeaderName, HeaderValue, CONTENT_LENGTH};
1010
use http_types::{Body, Method, Request, Response};
1111
use std::str::FromStr;
1212
use std::time::Duration;
@@ -383,7 +383,7 @@ where
383383

384384
// Check for content-length, that determines determines whether we can parse
385385
// it with a known length, or need to use chunked encoding.
386-
let len = match req.header(&CONTENT_TYPE) {
386+
let len = match req.header(&CONTENT_LENGTH) {
387387
Some(len) => len.last().unwrap().as_str().parse::<usize>()?,
388388
None => return Ok(Some(req)),
389389
};

0 commit comments

Comments
 (0)