From 970863ffb1b2524bce17964648b131a5c165a9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Fri, 13 Jul 2018 15:05:00 +0200 Subject: [PATCH] Set facets contentType --- src/api/web.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/web.rs b/src/api/web.rs index 505ec12..8c4ae0a 100644 --- a/src/api/web.rs +++ b/src/api/web.rs @@ -3,6 +3,8 @@ use std::path::{Path, PathBuf}; use rocket::request::Request; use rocket::response::{self, NamedFile, Responder}; +use rocket::response::content::Content; +use rocket::http::ContentType; use rocket::Route; use rocket_contrib::{Json, Value}; @@ -23,8 +25,10 @@ fn web_index() -> WebHeaders> { } #[get("/app-id.json")] -fn app_id() -> WebHeaders> { - WebHeaders(Json(json!({ +fn app_id() -> WebHeaders>> { + let content_type = ContentType::new("application", "fido.trusted-apps+json"); + + WebHeaders(Content(content_type, Json(json!({ "trustedFacets": [ { "version": { "major": 1, "minor": 0 }, @@ -33,7 +37,7 @@ fn app_id() -> WebHeaders> { "ios:bundle-id:com.8bit.bitwarden", "android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI" ] }] - }))) + })))) } #[get("/", rank = 1)] // Only match this if the other routes don't match