Skip to content

Commit 1ea3cef

Browse files
committed
sentry - `/cfg - add content-type for application/json
1 parent d43bb91 commit 1ea3cef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sentry/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ pub mod routes {
1111
pub mod channel;
1212
pub mod cfg {
1313
use crate::ResponseError;
14+
use hyper::header::CONTENT_TYPE;
1415
use hyper::{Body, Response};
1516
use primitives::Config;
1617

1718
pub fn return_config(config: &Config) -> Result<Response<Body>, ResponseError> {
1819
let config_str = serde_json::to_string(config)?;
1920

20-
Ok(Response::builder().body(Body::from(config_str)).unwrap())
21+
Ok(Response::builder()
22+
.header(CONTENT_TYPE, "application/json")
23+
.body(Body::from(config_str))
24+
.expect("Creating a response should never fail"))
2125
}
2226
}
2327
}

0 commit comments

Comments
 (0)