vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 970863ffb1b2524bce17964648b131a5c165a9ba
parent e876d3077a1914c139145fea39f5c9bea9894d63
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Fri, 13 Jul 2018 15:05:00 +0200

Set facets contentType

Diffstat:
Msrc/api/web.rs | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 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<io::Result<NamedFile>> { } #[get("/app-id.json")] -fn app_id() -> WebHeaders<Json<Value>> { - WebHeaders(Json(json!({ +fn app_id() -> WebHeaders<Content<Json<Value>>> { + 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<Json<Value>> { "ios:bundle-id:com.8bit.bitwarden", "android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI" ] }] - }))) + })))) } #[get("/<p..>", rank = 1)] // Only match this if the other routes don't match