mirror of
https://github.com/astro/buzzrelay.git
synced 2024-11-25 13:30:58 +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
|
// validate content-type
|
||||||
let content_type = if let Some(content_type) = req.headers()
|
let content_type = if let Some(content_type) = req.headers()
|
||||||
.get(CONTENT_TYPE)
|
.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
|
content_type
|
||||||
} else {
|
} else {
|
||||||
return Err((StatusCode::UNSUPPORTED_MEDIA_TYPE, "No content-type".to_string()));
|
return Err((StatusCode::UNSUPPORTED_MEDIA_TYPE, "No content-type".to_string()));
|
||||||
|
|
Loading…
Reference in a new issue