diff --git a/actix-web/src/types/form.rs b/actix-web/src/types/form.rs index d6381b990..91ae702c8 100644 --- a/actix-web/src/types/form.rs +++ b/actix-web/src/types/form.rs @@ -289,7 +289,7 @@ impl UrlEncoded { /// Create a new future to decode a URL encoded request payload. pub fn new(req: &HttpRequest, payload: &mut Payload) -> Self { // check content type - if req.content_type().to_lowercase() != "application/x-www-form-urlencoded" { + if req.content_type() != Some("application/x-www-form-urlencoded") { return Self::err(UrlencodedError::ContentType); } let encoding = match req.encoding() {