We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
/cfg
content-type
application/json
1 parent d43bb91 commit 1ea3cefCopy full SHA for 1ea3cef
sentry/src/lib.rs
@@ -11,13 +11,17 @@ pub mod routes {
11
pub mod channel;
12
pub mod cfg {
13
use crate::ResponseError;
14
+ use hyper::header::CONTENT_TYPE;
15
use hyper::{Body, Response};
16
use primitives::Config;
17
18
pub fn return_config(config: &Config) -> Result<Response<Body>, ResponseError> {
19
let config_str = serde_json::to_string(config)?;
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"))
25
}
26
27
0 commit comments