From c91c6b97939fe763000fd2c4492f2ff15c261069 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 16 Apr 2019 22:18:40 +0200 Subject: [PATCH] Add content-type header --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index aad6d85..cc5a8a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,7 +145,9 @@ fn calculate_hoc( let (tx, rx_body) = mpsc::unbounded(); let _ = tx.unbounded_send(Bytes::from(badge.to_svg().as_bytes())); - Ok(HttpResponse::Ok().streaming(rx_body.map_err(|_| error::ErrorBadRequest("bad request")))) + Ok(HttpResponse::Ok() + .content_type("image/svg+xml") + .streaming(rx_body.map_err(|_| error::ErrorBadRequest("bad request")))) } fn github(