From 832bd509268f58314ab45141c56aa8f4015146a4 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 15 Apr 2023 23:46:58 +0200 Subject: [PATCH] endpoint: fix content-type parsing --- src/endpoint.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/endpoint.rs b/src/endpoint.rs index c0cdd8a..9e8a978 100644 --- a/src/endpoint.rs +++ b/src/endpoint.rs @@ -48,7 +48,8 @@ where // validate content-type let content_type = if let Some(content_type) = req.headers() .get(CONTENT_TYPE) - .and_then(|value| value.to_str().ok()) { + .and_then(|value| value.to_str().ok()) + .and_then(|value| value.split(';').next()) { content_type } else { return Err((StatusCode::UNSUPPORTED_MEDIA_TYPE, "No content-type".to_string()));