Add content-type header

This commit is contained in:
Valentin Brandl 2019-04-16 22:18:40 +02:00
parent c6e6a9b5fe
commit c91c6b9793
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -145,7 +145,9 @@ fn calculate_hoc(
let (tx, rx_body) = mpsc::unbounded(); let (tx, rx_body) = mpsc::unbounded();
let _ = tx.unbounded_send(Bytes::from(badge.to_svg().as_bytes())); 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( fn github(