mirror of
https://github.com/astro/buzzrelay.git
synced 2024-11-22 04:00:59 +00:00
endpoint: fix content-type parsing
This commit is contained in:
parent
a8551ac48a
commit
832bd50926
1 changed files with 2 additions and 1 deletions
|
@ -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()));
|
||||
|
|
Loading…
Reference in a new issue