1739: Fix add document Content-Type r=curquiza a=MarinPostma

change the `Content-Type` guards of the document addition routes to match the specification.


Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
bors[bot] 2021-09-29 17:13:45 +00:00 committed by GitHub
commit 80ca42922f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,9 +33,9 @@ macro_rules! guard_content_type {
}; };
} }
guard_content_type!(guard_ndjson, "application/x-ndjson");
guard_content_type!(guard_csv, "text/csv");
guard_content_type!(guard_json, "application/json"); guard_content_type!(guard_json, "application/json");
guard_content_type!(guard_csv, "application/csv");
guard_content_type!(guard_ndjson, "application/ndjson");
fn empty_application_type(head: &actix_web::dev::RequestHead) -> bool { fn empty_application_type(head: &actix_web::dev::RequestHead) -> bool {
head.headers.get("Content-Type").is_none() head.headers.get("Content-Type").is_none()